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
https://forums.phpfreaks.com/topic/60891-php-and-css/
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
https://forums.phpfreaks.com/topic/60891-php-and-css/#findComment-303000
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
https://forums.phpfreaks.com/topic/60891-php-and-css/#findComment-303003
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
https://forums.phpfreaks.com/topic/60891-php-and-css/#findComment-303008
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.