2017-02-21 31 views
0

我有問題,而谷歌Chrome和Opera例如最小寬度標籤,在Firefox工作pefectlyCSS最小寬度在谷歌Chrome和Opera

例如,我想表現出與內嵌式地顯示與圖像轉換成的cols與此我看到完美的Firefox,圖像顯示爲石工,它很好,但在谷歌鉻顯示不好,它的最小寬度的問題,我怎麼能修復谷歌瀏覽器等,謝謝你,至於

#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; 
} 

你可以看到這裏的例子:

https://jsfiddle.net/rzfrjL1g/

SOLUTION:爲了修復這個問題只需要投入10%,而不是100%,並把最小寬度也和frnt_item_content IMG不寬

+1

發佈您的標記,以便我們有[mcve]。 –

+0

https://jsfiddle.net/rzfrjL1g/ – Carl

+0

是什麼? https://jsfiddle.net/rzfrjL1g/1/ –

回答

0

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

我已經從#frnt_item_content img刪除width: 100%屬性定義

它沒有任何意義,因爲#frnt_item doesn沒有固定的寬度。因此,如果圖像的寬度爲100%,那麼#frnt_item將延伸直至其父項的100%被填充。你的形象比例是這樣丟失,這就是爲什麼他們看起來如此有彈性:)

0

我解決了這個問題,通過添加寬度到CSS。嘗試添加寬度:10%到frnt_item