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
Page particular styles with php includes
Old 01-07-2009, 10:38 PM Page particular styles with php includes
Super Talker

Posts: 131
Trades: 0
My questions is:

When including something on all pages, a top nav for instance.. (<?php include('topnav.html'); ?>)
What is the best way to have a page particular style like say you wanted the "HOME" link to stay underlined when you're on the home page.

The answer is most likely using javascript and I'm proabably posting in the wrong forum.

If necessary, you can move this to the javascript forum.

Would the best way be to give the body an id?

Thanks
soap is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-08-2009, 06:31 AM Re: Page particular styles with php includes
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Give all your links IDs, then insert a style rule for the "active" page into the document head using PHP
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-08-2009, 09:52 AM Re: Page particular styles with php includes
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
The way I sometimes do it, is I have a unique variable identifying the page. Sometimes, if I have pages with certain themes that are the same, I will also have a theme variable identifying which theme it is. I then use these variables as hooks in the PHP, and also as classes (I put $page as a class on the body, and $theme in the various includes, wherever is appropriate).
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is online now
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Reply     « Reply to Page particular styles with php includes
 

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.41116 seconds with 12 queries