Content ignoring the maximum width in a Flexbox container in Firefox?
source link: https://www.codesd.com/item/content-ignoring-the-maximum-width-in-a-flexbox-container-in-firefox.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Content ignoring the maximum width in a Flexbox container in Firefox?
Wondering if anybody else is experiencing the following and either found a solution or may have suggestions.
The code below renders correctly on Chrome (35.0.1916.153), but it does not on Firefox (Firefox 29.0.1):
.container {
display: flex;
align-items: center;
width: 200px;
height: 200px;
border: 2px solid red;
overflow: hidden;
}
.container img {
max-width: 100%;
}
HTML:
<div class="container">
<img src="https://g.twimg.com/business/page/image/11TwitterForSmallBusiness-300_1.png"/>
</div>
A runnable example can be found here:
Add min-width: 1px;
to the .container
.
https://ntucker.true.io/ntucker/solution-firefox-34-ignoring-max-width-for-flexbox/
Related Articles
Div ignore the maximum width on the body
How to set the maximum width for div content that consists of images and text
CSS - the center of the body ignores the min-width
The maximum width does not work on the flexible element
WPF ListBoxItem does not extend to the maximum width
Why does the maximum width have a minimum width in a table cell?
WrapPanel: When trying to make the Width element equal to the maximum width of an element
the maximum width does not work for the table cell
Always get the maximum width / column space required for a DataGrid
Uploadify: Defining the maximum width and height of the image
Android ignores the maximum scale when using a fixed-width viewport meta-tag
Set div to the width of the content with a maximum width
What is the maximum width of the content area for web pages?
How to ignore the parent width limit in CSS
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK