標題部分中的我的標識應始終與父高度相同。圖像高度應該是父元素的高度
HTML
<header>
<div id="logo">
<a href="/">
<img src="img/logo.png" alt="Logo" />
</a>
</div>
</header>
CSS
*, *:before, *:after {
box-sizing: border-box;
}
header {
background-color: rgb(255,255,255);
height: 50px;
padding: 10px;
}
header #logo img {
height: auto;
max-height: 100%;
max-width: 100%;
}
洙,你有什麼問題嗎?或js-fiddle? – AchmadJP