【发布时间】:2015-02-05 11:04:09
【问题描述】:
我正在尝试为高度调整图像大小(我知道宽度:100%,高度:自动调整宽度)。以下设置适用于 Safari (~8.02) 但 Chrome 和 Firefox (最新) 根本不在乎。有任何想法吗?如果不存在 CSS hack,我对 jQuery 解决方案持开放态度(我猜)。
body, html {
width:100%;
height:100%;
}
body {
background: lightgreen;
}
.full {
width:100%;
}
.block {
background: lightcoral;
width: 80%;
text-align: center;
position: absolute;
}
.logo {
max-width: 100%;
max-height: 80%;
}
<div class="full">
<div class="block">
<img src="http://placehold.it/709x534" class="logo">
</div>
</div>
【问题讨论】:
标签: jquery html css google-chrome