当重新调整浏览器窗口大小时,Div将不会停留在原地并向上移动



我是网页设计的新手,我正在创建一个网页,在页面底部有一个条纹,当浏览器窗口最小化时向上移动。我希望最小化的时候完全看不到它。任何建议都将非常感谢。而不是张贴所有的html代码,我张贴了链接在这里:http://52.8.135.18/~lrodrig6/about.html。下面是条纹的CSS样式:

div.stripe {
width:100%;
height:9.375em;
position: absolute;
//top:0;
left:0;
bottom: 5.9375em;
background-image: url("space.jpg");
border-top-style: solid;
border-bottom-style: solid;
border-top-color: whitesmoke;
border-bottom-color: whitesmoke;
z-index: -1;
}

如果我理解正确的话,你想在屏幕很小的时候去掉行吗?

@media (max-width: 320px) { 
    div.stripe { display: none; }
}

如果屏幕是320或更小,上面的代码将使div.stripe不可见。把320改成你想要的大小

最新更新