-1
有人可以帮我弄清楚为什么我的徽标图片没有根据浏览器大小调整大小吗?使用响应式布局调整图片大小
---------------- CSS ---------------------
body {
height: 100%;
background-color:#333;
}
#logo {
max-width: 100%;
}
img {
border: 0;
max-width: 100%;
height: auto;
}
#header-bg {
background-image: url("header-bg.png");
overflow: auto;
width: 100%;
}
- --------------- HTML -------------------
<body>
<div id="header-bg">
<div id="logo">
<img src="logo.png" />
</div>
</div>
</body>
当我将宽度设置为100%时,它会在整个窗口上展开徽标。 – MG1 2013-02-12 16:41:51
@ MG1查看已更新的答案。希望有所帮助。 :) – 2013-02-12 16:43:40
我为你创建了一个jsFiddle来展示@Praveen Kumar解释:http://jsfiddle.net/persianturtle/4h2xU/1/ – 2013-02-12 16:53:46