Results 1 to 11 of 11

Thread: CSS gurus - ?

  1. #1
    Join Date
    3rd January 2005 - 11:00
    Bike
    All of them
    Location
    Brisvegas
    Posts
    12,472

    CSS gurus - ?

    You know how there are different styles for links: visited, hover, active, etc etc.

    Is there a style for 'current page' ?

    Say I'm on the 'about.html' page - can I make the about.html link in the nav menu display a different style when it's on that page?

    Never seen it - but worth a ping.

  2. #2
    Join Date
    9th November 2005 - 18:45
    Bike
    2005 Z750S
    Location
    Wellington
    Posts
    1,136
    I think "no", but as I hate HTML and CSS (I "do" some, but am no guru) am happy to be called stupid, or just wrong.

    Is the HTML hardcoded or "built" by ASP, PHP, ASPX or something?

    Is J(ava)Script in use?
    Measure once, cut twice. Practice makes perfect.

  3. #3
    Join Date
    31st July 2005 - 21:18
    Bike
    99 RSV Matte Mille, Bus 150 & 121
    Location
    Kelson, Wgtn
    Posts
    5,693
    No that I know of, however you could use PHP to check, and change your style on the fly (dynamically?).

    Otherwise www.w3schools.com is a good resource. Try the page about pseudo classes, and elements on the next page.

  4. #4
    Join Date
    3rd January 2005 - 11:00
    Bike
    All of them
    Location
    Brisvegas
    Posts
    12,472
    Quote Originally Posted by pzkpfw View Post
    I think "no", but as I hate HTML and CSS (I "do" some, but am no guru) am happy to be called stupid, or just wrong.

    Is the HTML hardcoded or "built" by ASP, PHP, ASPX or something?

    Is J(ava)Script in use?
    hard via dreamweaver and text editor mix. diy style sheets.

  5. #5
    Join Date
    20th November 2002 - 11:00
    Bike
    SW-125R(F4-TF125), ZXRD400, RD250LC
    Location
    Wellington, New Zealand,
    Posts
    5,963
    Blog Entries
    36
    You could still use a scripting language to query the page as to which one it is and change CSS to suit.
    I've done it with a PHP include menu file which has 'sticky' rollovers.

  6. #6
    Join Date
    30th July 2007 - 19:53
    Bike
    In between bikes
    Location
    Wellington
    Posts
    29

    a solution

    There isn't an automatic solution. But there are solutions that are easier to maintain than others. One solution we use sometimes is as follows (the following is essentially a sketch :-):
    HTML Code:
    --- in an external style sheet ---
    <style>
    li.nav ul { font-weight: normal }
    #home li.nav ul.home, #about li.nav ul.about, #another li.nav ul.another { font-weight: bold }
    </style>
    
    ---Page 1 ---
    <body id="about">
    <li id="nav">
      <ul class="home">Home</ul>
      <ul class ="about">About</ul>
      <ul class ="another">Another Page</ul>
    </li>
    </body>
    
    ---Page 2 ---
    <body id="home">
    <li>
      <ul class="home">Home</ul>
      <ul class ="about">About</ul>
      <ul class ="another">Another Page</ul>
    </li>
    </body>
    So the above probably doesn't actually work - but hopefully it shows the idea :-).

    You can hard code the class on to the body tag or better have it written in dynamically.

    Let me know if this makes no sense :-)

  7. #7
    Join Date
    3rd January 2005 - 11:00
    Bike
    All of them
    Location
    Brisvegas
    Posts
    12,472
    Quote Originally Posted by Scarydog View Post
    There isn't an automatic solution. But there are solutions that are easier to maintain than others. One solution we use sometimes is as follows (the following is essentially a sketch :-):
    HTML Code:
    --- in an external style sheet ---
    
    li.nav ul { font-weight: normal }
    #home li.nav ul.home, #about li.nav ul.about, #another li.nav ul.another { font-weight: bold }
    
    
    ---Page 1 ---
    
    
      Home
      About
      Another Page
    
    
    
    ---Page 2 ---
    
    
      Home
      About
      Another Page
    
    So the above probably doesn't actually work - but hopefully it shows the idea :-).

    You can hard code the class on to the body tag or better have it written in dynamically.

    Let me know if this makes no sense :-)
    Yeah - I see it. Thanks.

    For 6 or so relevant pages on this site it's easier to remove the link and just text style it.

    this is an upgrade - time is moolah and all that.

    Next time I'm starting from scratch will give it a try.

  8. #8
    Join Date
    19th January 2006 - 19:13
    Bike
    mutton dressed up as lamb and a 73 XL250
    Location
    On any given sunday?
    Posts
    9,032
    Damn you boys make life complicated.
    Be the person your dog thinks you are...

  9. #9
    Join Date
    3rd January 2005 - 11:00
    Bike
    All of them
    Location
    Brisvegas
    Posts
    12,472
    Quote Originally Posted by 98tls View Post
    Damn you boys make life complicated.
    Beats watching TV - unless there is a game of something worthwhile on.

  10. #10
    Join Date
    19th January 2006 - 19:13
    Bike
    mutton dressed up as lamb and a 73 XL250
    Location
    On any given sunday?
    Posts
    9,032
    Quote Originally Posted by Big Dave View Post
    Beats watching TV - unless there is a game of something worthwhile on.
    Agreed,i hate TV.Watch it less now Mr deans moved.The garage and an assortment of 2 wheelers both young and old is nirvana to this ole boy.
    Be the person your dog thinks you are...

  11. #11
    Join Date
    3rd January 2005 - 11:00
    Bike
    All of them
    Location
    Brisvegas
    Posts
    12,472
    Quote Originally Posted by 98tls View Post
    .Watch it less now Mr deans moved.
    I said 'worthwhile'.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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