以下是带有左右额外图像的菜单行代码。我需要这样的行为:当屏幕宽度从960px到1398px时,左右div同时隐藏。这段代码确实做到了我想要的!问题在于在低屏幕宽度(960px到1398px)上,它会向浏览器添加水平滚动条:(但是根据我的想法,只需要在屏幕宽度小于960px时才需要垂直滚动。有什么建议可以解决这个问题吗?谢谢。
html:
html:
<div class="bxt">
<div class="boxone"></div>
<div class="center"></div>
<div class="boxtwo"></div>
</div>
CSS:
.bxt{
width:960px;
height:72px;
margin:0 auto;
position:relative;
/*background-color:#000 */
}
.bxt div{
position:absolute;
width:219px;
/* background:#CCCCCC; */
top:0;
height:72px;
margin:0 0 0 0;
}
.bxt div.boxone{
left:-219px;
margin:0 0 0 0;
background-image:url(images/i_02.jpg)
}
.bxt div.boxtwo{
right:-219px;
margin:0 0 0 0;
background-image:url(images/i_04.jpg)
}
.bxt div.center{
width:960px;
height:72px;
right:0;
/* background:#AAAAAA; */
background-image:url(images/i_03.jpg);
}