html - Hide a section of the navigation menu on mobile and get mobile stylesheets to work -
my website has five-section navigation bar on desktop , it's supposed have 4 visible sections on mobile. cannot mobile style sheets work @ all, , don't know how hide last section of nav bar , child.
in every page have linked 3 style sheets:
<link rel="stylesheet" type="text/css" media="only screen , (max-width: 767px)" href="css/small_device.css"/> <link rel="stylesheet" type="text/css" media="only screen , (min-width: 768px) , (max-width: 959px)" href="css/medium_device.css"/> <link rel="stylesheet" type="text/css" href="css/style.css"/>
and in style sheets tried make navigation wanted hidden hidden adding this:
.vendors { display: none;}
instead of there:
.drop_menu { background:#000000; background-repeat: no-repeat; padding:0; margin:0; list-style-type:none; height:150px; } .drop_menu li { float:left; } .drop_menu li { padding:10px 30px; display:block; color:#ffffff; text-decoration:none; font:1em arial, verdana, sans-serif; } /* submenu */ .drop_menu ul { position:absolute; left:-9999px; top:-9999px; list-style-type:none; } .drop_menu li:hover { position:relative; background:#0a208d; } .drop_menu li:hover ul { left:0px; top:30px; background:#0a208d; padding:0px; } .drop_menu li:hover ul li { padding:5px; display:block; width:170px; text-indent:15px; background-color:#0a208d; } .drop_menu li:hover ul li a:hover { background:#000000; }
because in navigation have
<div class="drop"> <ul class="drop_menu"> <li>. . . </li> <li>. . . </li> <li>. . . </li> <li>. . . </li> <li><a href="vendors.html" class="vendors">vendors</a> <ul> <li><a href="register.html" class="vendors">register</a></li> </ul> </li> </ul> </div>
sorry if missed already-answered post i've been searching hours , couldn't find much. did find told me link stylesheet(s) , use @media thing. don't know i'm supposed put @media blah blah {} , when did try put in style sheets didn't anything. help?
if want consolidate 1 stylesheet, proper way of using @media
following:
@media screen , (min-width: 768px) , (max-width: 767px) { .vendors { display: none; } /* styles both max-width 767px , min-width 768px */ } @media screen , (max-width: 767px) { /* styles max-width 767px */ } @media screen , (min-width: 768px) { /* styles min-width 768px */ }
if want hide of <li>
particular screen resolution, vendors
class should on li
tag , not a
tag.
Comments
Post a Comment