CSS Menu Code for you

Discussion in 'CSS' started by Crimsonc, Apr 4, 2007.

  1. #1
    This is a horizontal menu, background colour and text colour changes on rollover.

    #nav {
    width: 780px;
    margin: 0 auto;
    background-color: #F3F2ED;
    margin-top: 5px;}
     #nav ul {
    	margin: 0;
    	padding: 0;
    	list-style: none;
    	margin-left: 10px;
    	background-color: #F3F2ED;}
             #nav li {
    	    float: left;
    	    margin: 0;
    	    padding: 0;
    	    background-color: #F3F2ED;}
    	     #nav li a {
    	        float: left;
    	        margin: 0 1px 0 0;
                    font-size: 100%;
    	        font-weight: normal;
    	        text-decoration: none;
                    padding: 5px 9px;
    	        color: #555;}
    	          #nav li a:hover {
    	             color: #fff;
    	             background: #354966;}
    Code (markup):
    And the XTHML

    
    <div id="nav">
            <ul>
    	<li><A href="#">Option</a></li>
    	<li><A href="#">Option</a></li>
    	<li><A href="#">Option</a></li>
    	<li><A href="#">Option</a></li>
    	<li><A href="#">Option</a></li>
    	<li><A href="#">Option</a></li>
    	<li><A href="#">Option</a></li>
    	</ul>
    </div>
    
    Code (markup):

     
    Crimsonc, Apr 4, 2007 IP
  2. petyard

    petyard Well-Known Member

    Messages:
    2,025
    Likes Received:
    39
    Best Answers:
    0
    Trophy Points:
    185
    #2
    nice, simple and easy
    thanks
     
    petyard, Apr 4, 2007 IP
  3. boyponga

    boyponga Banned

    Messages:
    1,013
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Can I see the site please? I would like to see what it looks like. :)
     
    boyponga, Apr 5, 2007 IP
  4. petyard

    petyard Well-Known Member

    Messages:
    2,025
    Likes Received:
    39
    Best Answers:
    0
    Trophy Points:
    185
    #4
    just copy the code above and use it to create a htm. file
    is not that hard
     
    petyard, Apr 5, 2007 IP
  5. boyponga

    boyponga Banned

    Messages:
    1,013
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Nice menu, better for sites with horizontal menu. :)
     
    boyponga, Apr 5, 2007 IP
  6. Jim/designer

    Jim/designer Guest

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Cool, you should add an example page (even IF we can copy it).
     
    Jim/designer, Apr 5, 2007 IP
  7. Crimsonc

    Crimsonc Peon

    Messages:
    616
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
  8. Dima_2005

    Dima_2005 Peon

    Messages:
    48
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Well, it's nice, but in IE7 you'll get some bugs with that, but ok... it's not so visible. Only if you use it in vertical with arrows or something like that
     
    Dima_2005, Apr 6, 2007 IP
  9. Crimsonc

    Crimsonc Peon

    Messages:
    616
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #9
    so your saying, if this was a different menu and I used arrows, I would get errors in IE7? if so, thats irrelevent.
     
    Crimsonc, Apr 6, 2007 IP
  10. Dima_2005

    Dima_2005 Peon

    Messages:
    48
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    No, I mean if you will add an list-style-image... then you'll get very weird not centered image
     
    Dima_2005, Apr 6, 2007 IP
  11. im2lazy

    im2lazy Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    If you are looking for some basic but fun CSS code visit CSSPlay.co.uk !
     
    im2lazy, Apr 6, 2007 IP