2010-12-15 176 views
1
.post-body p img { 
    min-width:100%; 
    margin-bottom:15px; 
} 
.post-body p img.thumb-small { 
    min-width:auto !important; 
    max-width:100%; 
    margin-bottom:15px; 
} 

我希望我身後所有的圖像都是最小寬度100%。但是,如果圖像有一類拇指小,應該有沒有最小寬度? 我該如何反轉該圖像與此類的行爲?css最小寬度和最大寬度?

謝謝

回答

1

我怎麼可以反轉 圖像與本類的行爲嗎?

.post-body p img.thumb-small { 
    min-width:0; 
    } 
1

你可以只指定一個零min-width爲縮略圖:

.post-body p img.thumb-small { 
    min-width: 0; 
    max-width: 100%; 
    margin-bottom: 15px; 
} 

你不需要!important。樣式規則更具體,所以無論如何它將優先。

1

還沒有籤,但

min-width: 0; 

應該工作,沒有必要!重要的是,你已經覆蓋與添加的類的規則。