Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jul 2009
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts

    CSS: Positioning a pop out navigation menu

    Hi,

    I am putting a pop out navigation menu together but I cannot seem to position it to where I want it to be.

    I want it to be 100px from the top, What do I need to change in my CSS file to adjust it?

    Code:
    //The CSS File
    
    #menu {
    	width: 12em;
    	background:#eee;
    }
    #menu ul {
    	list-style: none;
    	margin: 0;
    	padding: 0;
    }
    
    #menu a, #menu h2 {
    	font: bold 11px/16px arial, helvetica, sans-serif;
    	width:17em;
    	height:3.6em;
    	display: block;
    	border-width: 1px;
    	border-style: solid;
    	border-color: #ccc #888 #555 #bbb;
    	margin: 0;
    	padding: 2px 3px;
    }
    
    #menu h2 {
    color: #fff;
    background-image:url(Images/Buttonbkg.jpg);
    text-transform: uppercase;
    }
    
    #menu a {
    color: #000;
    background-image:url(Images/Buttonbkg.jpg);
    text-decoration: none;
    }
    
    #menu a:hover {
    	color: #fff;
    	background-image:url(Images/Buttonbkg2.jpg);
    }
    
    /* The slide out menu*/
    
    #menu ul ul ul {
    position: absolute;
    top:0;
    left: 0;
    }
    
    #menu li {
    	position: relative;
    	top:0;
    }
    
    #menu ul ul ul {
    position: absolute;
    top:0;
    left: 100%;
    width: 100%;
    }
    
    
    
    /* makes the menu appear and disappear*/
    
    div#menu ul ul ul 
    {display: none;}
    
    div#menu ul ul li:hover ul 
    {display: block;}
    
    div#menu ul ul ul,
    div#menu ul ul li:hover ul ul
    {display: none;}
    
    /* Allows the first pop out layers to be displayed*/
    
    div#menu ul ul li:hover ul 
    {display: block;}
    
    div#menu ul ul ul,
    div#menu ul ul li:hover ul ul
    {display: none;}
    
    div#menu ul ul li:hover ul,
    div#menu ul ul ul li:hover ul
    {display: block;}
    Html file

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="popout.css" rel="stylesheet" type="text/css" />
    <title>Untitled Document</title>
    </head>
    
    <body>
    <!--[if IE]>
    <style type="text/css" media="screen">
    body {behavior: url(csshover.htc);} 
    
    </style>
    <![endif]-->
    <div id="menu">
    <ul>
      <li><h2>Weather In A Flash</h2>
        <ul>
          <li><a href="" title="">Current Weather</a>
            <ul>
              <li><a href="" title="">United Kingdon</a></li>
              <li><a href="" title="">World Weather</a></li>
              <li><a href="" title="">Lancashire</a></li>
            </ul>
          </li>
        </ul>
        <ul>
          <li><a href="" title="">Lightning</a>
            <ul>
              <li><a href="" title="">Live Lightning</a></li>
              <li><a href="" title="">Lightning (15 min Delay)</a></li>
              <li><a href="" title="">Current Storms</a></li>
            </ul>
          </li>
        </ul>
        <ul>
          <li><a href="" title="">Weather Forecast</a>
            <ul>
              <li><a href="" title="">Five Day Forecast</a></li>
              <li><a href="" title="">Choose Your County</a></li>
              <li><a href="" title="">Sub Option 3</a></li>
            </ul>
          </li>
        </ul>
         <ul>
          <li><a href="" title="">Photo Albums</a>
            <ul>
              <li><a href="" title="">Photo Album 1</a></li>
              <li><a href="" title="">Photo Album 2</a></li>
              <li><a href="" title="">Photo Album 3</a></li>
              <li><a href="" title="">Photo Album 4</a></li>
            </ul>
          </li>
        </ul>
        
    <!-- need these below -->   
        
      </li>
    </ul>
    </div>
    </body>
    </html>
    Thanks

    RandomRobbo

  • #2
    New Coder
    Join Date
    Oct 2008
    Posts
    23
    Thanks
    2
    Thanked 1 Time in 1 Post
    #menu {
    width: 12em;
    background:#eee;
    position:absolute;
    top:100px;
    margin: 0 auto; /*center it*/
    }

  • Users who have thanked mikhial66 for this post:

    RandomRobbo (08-08-2011)

  • #3
    New to the CF scene
    Join Date
    Jul 2009
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Mikhail66, you are a star!

    Thank you very much!

    RandomRobbo


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •