简体   繁体   English

谷歌浏览器和Opera中的CSS最小宽度

[英]css min-width in google chrome and opera

I have problem with the min-width tag for Google Chrome and Opera for example , in firefox works pefectly 例如,我在Google Chrome和Opera的最小宽度标签上遇到了问题,在Firefox中可以正常工作

For example i want show cols with display inline and with image into with this i see perfect in firefox , the images show as masonry and it´s nice but in google chrome show bad and the problem it´s with min-width , how i can fix this in Google Chrome , etc , thank´s , regards 例如,我想显示行内显示和图像,我在firefox中看到完美,图像显示为砖石结构,很好,但在谷歌浏览器中显示不好,最小宽度问题,如何显示可以在Chrome浏览器中修复此问题,等等,谢谢

#frnt_item
{
display:inline-block;
position:relative;
min-width:10%;
max-height:350px;
border:1px solid #EEE;
vertical-align:text-top;
margin-left:7px;
margin-bottom:7px;
-webkit-border-radius: 10px;
-webkit-border-top-right-radius: 2px;
-webkit-border-bottom-left-radius: 2px;
-moz-border-radius: 10px;
-moz-border-radius-topright: 2px;
-moz-border-radius-bottomleft: 2px;
border-radius: 10px;
border-top-right-radius: 2px;
border-bottom-left-radius: 2px;
overflow:hidden;
cursor:pointer;
cursor:hand;
}




#frnt_item_content img
{
width:100%;
max-height:350px;   
}

You can see example here : 您可以在此处查看示例:

https://jsfiddle.net/rzfrjL1g/ https://jsfiddle.net/rzfrjL1g/

SOLUTION : For fix this problem only need put 10 % and not 100 % and put min-width also and not width in frnt_item_content img 解决方案:要解决此问题,只需将10%而不是100%放进去,也将min-width放进去,而不要在frnt_item_content img放宽

https://jsfiddle.net/rzfrjL1g/2/ https://jsfiddle.net/rzfrjL1g/2/

I've removed the width: 100% attribute definition from #frnt_item_content img 我已经从#frnt_item_content img删除了width: 100%属性定义

It makes no sense because #frnt_item doesn't have a fixed width. 这没有任何意义,因为#frnt_item没有固定的宽度。 Therefor if the width of the image is 100%, the #frnt_item will stretch until 100% of it's parent is filled. 因此,如果图像的宽度为100%,则#frnt_item将拉伸,直到其父图像的100%被填充。 The ratio of your image is lost this way, that's why they look so stretchy :) 这样就失去了图像的比例,这就是为什么它们看起来如此拉伸的原因:)

I solved such problem by add width to css. 我通过添加宽度到CSS解决了这样的问题。 Try to add width:10% to frnt_item 尝试将宽度:10%添加到frnt_item

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM