Jump to content

PHP and CSS


TheFilmGod

Recommended Posts

I would like to make a php script. I have 8 links in the menu. Depending on the variable "current" (page) one of those corresponding links would have a certain class created by the php. So if it was contact us -> the contact us link would be given a special class, while the others would not. This would allow that certain link to have a different color and let users know what section they are at. I want a header that is the same for all pages. Thus, making a separate one 4 each section is not practical.

 

Any ideas?

Link to comment
Share on other sites

http://css.maxdesign.com.au/listamatic/ - there's your menu solution, with php changing the css class of the current page link.

 

The same header for each page is done using include().

 

 

Umm. I went to the link and there are a billion different links to other pages on it! Which one? I searched the word "php" and didn't find it... ???

 

Yes, I'm using include()

Link to comment
Share on other sites

Umm. I went to the link and there are a billion different links to other pages on it! Which one?

 

You want it all handed to you on a plate???

 

Look at the various menu alternatives. Find one you like. Check the CSS and HTML code given for it. See how simple it is to add a little bit of php to determine if a link is the same as the 'current' page and in that case change its class.

Link to comment
Share on other sites

http://css.maxdesign.com.au/listamatic/ - there's your menu solution, with php changing the css class of the current page link.

 

Well, I got the menu finished. Already done! I was just wondering about the php itself how to code it. I don't need help with the links themselves. And when you said "PHP CHANGING THE CSS CLASS" I thought their was an exact article with that in it. But I guess not...

 

Thanks anyway Andyb!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.