Coding for navigational menus?

Discussion in 'CSS' started by tptnyc, Apr 21, 2007.

  1. #1
    New Coder:Need help writing coding for navigational menus - like About US, Contact, Products.
    Please show some coding example here.
     
    tptnyc, Apr 21, 2007 IP
  2. cbn81

    cbn81 Peon

    Messages:
    160
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    How do you want your menu? Vertical, horizontal, colors, hover...
     
    cbn81, Apr 21, 2007 IP
  3. tptnyc

    tptnyc Peon

    Messages:
    764
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    on left vertically with color and hoover, if possible?

    ABOUT US
    CONTACT
    PRODUCT 1
    PRODUCT 2
    and so on...
     
    tptnyc, Apr 21, 2007 IP
  4. cbn81

    cbn81 Peon

    Messages:
    160
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I would suggest something like:

    HTML file:

    <div id="leftMenu">
    <ul>
    <li>ABOUT US</li>
    <li>CONTACT</li>
    <li>PRODUCT 1</li>
    <li>PRODUCT 2</li>
    </ul>
    </div>
    Code (markup):
    CSS file:

    
    div#leftmenu ul
    {
     /* the style you want*/
    }
    
    div#leftmenu li
    {
     /* the style you want*/
    }
    
    Code (markup):
     
    cbn81, Apr 21, 2007 IP
  5. tptnyc

    tptnyc Peon

    Messages:
    764
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks a lot. I have done html coding but for css coding where do I place css coding to get that effect or it has to be in a separate file. By the way, website is not yet hosted.
     
    tptnyc, Apr 21, 2007 IP
  6. semantic7

    semantic7 Member

    Messages:
    92
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    48
    #6
    The css or the link to css file has to be placed just above the </head> tag. Do a "view source" on any website for examples.
     
    semantic7, Apr 21, 2007 IP
  7. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #7
    You can actually strip the DIV container, and put the styles on the list itself (after you move the ID from the DIV to the UL element, of course).

    tptnyc, have you looked at www.alistapart.com by any chance? ALA has some articles on CSS that you'll want to look at. Most of them use more code than necessary (since they try to cater the code they write to cover as many situations and skill levels as possible), but they should still be usable to you as is. Just try to avoid using positioning and use floats and margins instead. :)
     
    Dan Schulz, Apr 26, 2007 IP