Site LAYOUT HELP!

Discussion in 'HTML & Website Design' started by sitedesigner, Jun 18, 2008.

  1. #1
    Ok, so here's my navigation code.


    
    <li><a href="#" title="title goes here." class="current"><span>Company</span></a></li>
    <li><a href="#" title="title goes here."><span>Services</span></a></li>
    <li><a href="#" title="title goes here."><span>Resources</span></a></li>
    <li><a href="#" title="title goes here."><span>Media</span></a></li>
    <li><a href="#" title="title goes here."><span>Contact</span></a></li>
    <li><a href="#" title="title goes here."><span>Careers</span></a></li>
    
    HTML:
    My question is here... how can I include this on every page and based on the page name, have the "class = current" for the appropriate page?

    Thanks!

    -David
     
    sitedesigner, Jun 18, 2008 IP
  2. blktallos

    blktallos Active Member

    Messages:
    314
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #2
    you would use a CSS file :)
     
    blktallos, Jun 18, 2008 IP
  3. sitedesigner

    sitedesigner Peon

    Messages:
    578
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I know that silly!

    What I need to know is HOW.

    Is there a way to universalize it across the board?
     
    sitedesigner, Jun 18, 2008 IP
  4. wierdo

    wierdo Well-Known Member

    Messages:
    1,646
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    140
    #4
    Not 100% sure what you're talking about, but couldn't you use PHP for this?
     
    wierdo, Jun 18, 2008 IP
  5. sitedesigner

    sitedesigner Peon

    Messages:
    578
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I got it taken care of over at sitepoint :)
     
    sitedesigner, Jul 3, 2008 IP
  6. peter.walls

    peter.walls Banned

    Messages:
    72
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Thank for giving information to related to web development .. Gud going .
     
    peter.walls, Jul 4, 2008 IP
  7. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Well, for anyone reading this thread who wants to know, you'd usually have an id on the body, different for each page, and then use that for your CMS reference.

    <body id="company">
    now you have an id to reference with your PHP or whatever... a class would also do the trick. This page generates the php/whatever include with the class="current" in the first li.

    With static HTML pages, you simply type class="current" on the appropriate li (or a) per page.

    I suppose you could possibly use something goofy with static pages where each HTML page gets the unique body id, and then a creative use of child selectors in the CSS could do it too, in place of any classes. This only works if nothing is ever added to the menus though.
     
    Stomme poes, Jul 4, 2008 IP