简体   繁体   中英

I can not figure out why my drop down menue is not hiding

So, I can not figure out why my drop down menu is not hiding my #nav ul is set to left:-999px and so it should be way off screen, but for some reason it is not hiding and instead just sitting in plain view. BTW my nav bar is a PHP include, I have gotten this to work before, I probably just missed something along the way and it is probably just a stupid mistake on my part, feel free to call me an idiot, but I can not for the life of me figure out what I did wrong this time.

Here is a link to it hosted: http://addisonbwilson.com/Index.php

The CSS

@charset "UTF-8";
/* CSS Document */

/*The body is responsiable for the background image, the rest of the site is divided between the sub wrapper and the includes */
/*bground tile is from http://subtlepatterns.com/white-brushed/ created by Andre Schouten, crediting him here as per the usage agreement */
body {margin-top: 0px; background-image:url(../Portfolio/IMAGES/brushed_@2X.png)} 
/* navbar is a php include*/

#navbarwrapper{positon: absolute; width:980px; height: 120px; z-index:30; background-color:#FFF;}
#navbar{width:980px; height:120px; background-image:url(../Portfolio/IMAGES/Bannerbgimg.png); background-repeat:repeat-x; z-index:31;}
#navbarlogo{width:210px; height:120px; float:left; z-index:32;}
#navbarcontent{width:770px; height:120px; float:left; font-family:Verdana, Geneva, sans-serif; z-index:32;}
#wrapper{width:980px; height:auto;}
#subwrapper{width: 980px; height: auto;}
#imagecontainer{width: 320px; height: 320px; background-color:#FFF; margin:3px 3px 3px 3px;} 


/*Unordered lists which are used to handle drop down nav bar*/
#nav{
        list-style:none;
        font-family:Helvetica, Arial, sans-serif;
        margin-bottom:10px;
        float: right;
        width:100%;
        position:relative;
    }
#nav li{float:left; margin-right:10px; position:relative;}
#nav a{display:block; padding:5px; color:#000; text-decoration:none;}
#nav a:hover{color:#fff; background:#000; text-decoration:none;}
<!-- drop down -->
#nav ul{ 
    background:#fff; 
    background:rbga(255,255,255,0);
    list-style:none;
    position:absolute;
    left:-9999px !important;}
#nav ul li{ padding-top:1px; float:none; list-style:none;}
#nav ul a{white-space:nowrap;}
#nav li:hover ul{ left:0;}
#nav li:hover a{background:#ccc; text-decoration:underline;}
#nav li:hover ul a{text-decoration:none;}
#nav li:hover ul li a:hover{background:#000;}

h1{font-size:large}
h2{font-size:larger}
h3{font-size:medium}
img {border:none}



/*link modification*/
a:link{ text-decoration: none; color:#FFF; font-family: Helvetica, Arial, sans-serif}
a:visited{text-decoration: none;color:#FFF; font-family: Helvetica, Arial, sans-serif}
a:active{text-decoration: none;color:#FFF; font-family: Helvetica, Arial, sans-serif}
a:hover{text-decoration: none; color:#FFF; font-family: Helvetica, Arial, sans-serif}

The navbar.php

<link rel="stylesheet" type="text/css" href="Portfolio/CODE/pcss.css">
<div id="navbarwrapper">
<div id="navbar">
        <div id="navbarlogo"><a href="index.php"><img src="Portfolio/IMAGES/awlogo.png" /></a></div>
        <!--- nav --->
        <div id="navbarcontent">       
          <ul id="nav">
                <li><a href="#">Portfolio</a>
                    <ul>
                        <li><a href="SUBPAGES/Photography.php">Photography</a></li>
                        <li><a href="SUBPAGES/GFX.php">Graphic Art</a></li>
                        <li><a href="SUBPAGES/WebDesign.php">Web Design</a></li>
                        <li><a href="SUBPAGES/GameDesign.php">Game Design</a></li>
                    </ul>
                </li>    
                <li><a href="#">About Me</a>
                    <ul>
                        <li><a href="SUBPAGES/Resume.php">Resume</a></li>
                    </ul>
                </li>   
                <li><a href="#">Contact</a>
                    <ul>
                        <li><a href="subpages/SocialMedia.php">Social Media</a></li>
                        <li><a href="subpages/CInfo.php">Contact Information</a></li>
                    </ul>
                </li>

    </ul><!--- end nav --->

  </div> <!--- navbar --->     

</div> <!-- navbarwrapper --->

The site itself is just an include tag for the nav and a wrapper for the content, which is empty atm.

<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Addison Wilson</title>
<link rel="stylesheet" type="text/css" href="Portfolio/CODE/pcss.css">
</head>

<body>

    <?php include ("Portfolio/INCLUDES/navbar.php"); ?>

    <div id="wrapper">




    </div><!--wrapper-->



</body>




</html>

I browsed to the site in your link, but I couldn't find the dropdown css in the uploaded css file.

So by using the live edit tool in Firefox, I added the css that you have in your question,

#nav ul{ 
    background:#fff; 
    background:rbga(255,255,255,0);
    list-style:none;
    position:absolute;
    left:-9999px !important;}

and the submenu disappeared off screen. Could you double check that the css file on the server is up to date?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM