我想设置一个隐藏菜单栏的页面,具体取决于屏幕的大小。我设置了它,以便当有人将它设置为移动屏幕尺寸(我相信 480 像素)时,这个菜单栏应该会消失。但是,当我将 nag 分配给 display:none 时,它根本不会出现在页面上。这是代码:
这是网址:http://matthewtbrown.com/jeffandcricketquilt/liquid/index2.html
<nav class="fluid fluidList hide_mobile">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="quiltshowphotos.html">Quilt Show Photos</a></li>
<li><a href="videotutorials.html">Video Tutorials</a></li>
<li><a>Services</a>
<ul>
<li><a href="quiltphotography.html">Quilt Photography</a></li>
<li><a href="photostofabric.html">Photos to Fabric Transfers</a></li>
<li><a href="download.html">Downloadable Patterns</a></li>
</ul>
</li>
<li><a>About Us</a>
<ul>
<li><a href="contactus.html">Contact Us</a></li>
<li><a href="photocredit.html">Photo Credit</a></li>
</ul>
</li>
</ul></nav>
这是 CSS: /* 移动布局:480px 及以下。 */
.gridContainer {
margin-left: auto;
margin-right: auto;
width: 86.45%;
padding-left: 2.275%;
padding-right: 2.275%;
clear: none;
float: none;
background-image: url(../images/pattern2.jpg);
background-repeat: repeat;
min-width: 480px;
}
#div1 {
}
.zeroMargin_mobile {
margin-left: 0;
}
.hide_mobile {
display: none;
}
最佳答案
放
.hide_mobile {display:block} 在@media only screen and (min-width: 769px) area 然后把.hide_mobile {display:none} in the @media only screen and (max-width:480px) area .
如果有帮助请告诉我。
关于CSS 导航栏未出现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16270412/