Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
CSS per page navbar selection
Old 11-17-2009, 06:35 PM CSS per page navbar selection
bswinnerton's Avatar
Skilled Talker

Posts: 57
Location: Montville, CT
Trades: 0
I have a CSS navbar that has a border left and border right of the currently shown page:



Using the following CSS:
Code:
#navlist_current 
{
    border-style: solid;
    border-width: 0px 2px 0px 2px;
    padding: 3px 0px 3px 0px;
    margin-right: 2px;
}
and in HTML I have:
Code:
<div id="navcontainer">
    <ul id="navlist">
      <li><a href="/" id="navlist_current">Home</a></li>
What is the best way of going about so that depending on the page the visitor is looking at, it uses the a id navlist_current? I was thinking either with php variables or something along those lines.

Does anyone have any ideas?

Thanks
bswinnerton is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-18-2009, 11:29 AM Re: CSS per page navbar selection
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
It's easiest to apply a CLASS with the styling you want for "current".. so on each page one nav item would have 'class="current"' on it.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 11-18-2009, 11:35 AM Re: CSS per page navbar selection
bswinnerton's Avatar
Skilled Talker

Posts: 57
Location: Montville, CT
Trades: 0
Well see, my problem is that I have a php include called header.php which has all of the navbar and HTML meta tags, css includes etc. So it wouldn't really be beneficial to go on each page and change it manually.
bswinnerton is offline
Reply With Quote
View Public Profile
 
Old 11-18-2009, 11:38 AM Re: CSS per page navbar selection
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
Well, you could use (or write) a function that changes the class for you based on the page. CMS systems do this all the time.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 11-19-2009, 09:06 AM Re: CSS per page navbar selection
bswinnerton's Avatar
Skilled Talker

Posts: 57
Location: Montville, CT
Trades: 0
Hmm, how would I begin my search for a function like that?
bswinnerton is offline
Reply With Quote
View Public Profile
 
Old 11-19-2009, 04:09 PM Re: CSS per page navbar selection
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
http://www.webmasterworld.com/forum88/2068.htm

http://www.sebastiansulinski.co.uk/t...th_php_and_css
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 11-20-2009, 09:18 AM Re: CSS per page navbar selection
bswinnerton's Avatar
Skilled Talker

Posts: 57
Location: Montville, CT
Trades: 0
Thanks! I think that will help me get started.
bswinnerton is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to CSS per page navbar selection
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.24670 seconds with 12 queries