[英]Dynamically set CSS img max-height + max-width attribute to window size before page load?
[英]How can I remove the CSS width and height and set my own max-width from img tag?
因此,我將主題的css文件包含到應用程序中,它包含以下內容:
.status .who img {
float: left;
height: 40px;
margin-right: 10px;
width: 40px;
}
我需要的是這樣的:
.status .who img {
float: left;
max-width: 100%
margin-right: 10px;
}
但是我不確定我是否可以僅通過CSS來做到這一點。 我是否需要使用jQuery從那里刪除高度和寬度,還是可以從CSS做到這一點?
請試試:
.status .who img {
float: left;
width: auto;
height: auto;
max-width: 100%
margin-right: 10px;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.