2
我是一个比较新的HTML/CSS。我已经开始开发一个网站,但我的主要“英雄”形象不适合较小的页面并留下空白区域。如果你能帮助我诊断问题,将不胜感激。CSS背景图片不适应屏幕尺寸
*/CSS */
#intro {
z-index: 100;
width: 100%;
height: 66%;
background: url("../images/intro2.jpg"); center center no-repeat;
background-size: cover;
background-repeat: no-repeat;
top:10%;
background-position: 0px -150px;
left: 0;
position: absolute;
background-size: 100%;
}
#intro .wrap{
margin: 0 auto;
position: relative;
}
#intro .content{
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
vertical-align: baseline;
}
*/HTML */
<section id="intro">
<div class="wrap">
<div class="content">
<h1 id="welcome"> Your number one choice for music <br> in the south coast </h1>
</div>
</div>
</section>
该网站还可以查看Here
'#style'中有两个'background-size'属性;你想保留哪一个?此外,“背景位置”看起来可疑;你确定这就是你想要的吗? –
第一个背景声明也看起来不太洁净。我可能是错的,但我相信URL(..)语句后应该没有分号。 – Ideogram
background-position:cover;不要设置宽度或高度的BG - 图像...应该是好的 – Careen