|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
changing css styles with php
I have a header.inc and a css style sheet that are called to each page of a website via php. In the style sheet there are two styles that I would like to change depending on the section of the website.
For example: in the style sheet css id "subnav" has background: #E8EDF5 and cssi id "subtitle" has background #E8EDF5 however in each major section of the website I would like to change the background colors of the divs that have id "subnav" and "subtitle". Is there type of php statement that I could place at the top of my website pages that would allow me to specify the colors of these two css ids? Hope I have made this clear. |
|
#2
|
||||
|
||||
|
Short answer: No.
Long answer: Yes, but you'll have to create a script that output the css based on the page calling it. Another way is to create diferent style sheets for every section. Or you could place the statements subnav and subtitle in a <style> in the page you create and not in the style sheet... |
|
#3
|
|||
|
|||
|
PHP Code:
If that's not ok, then you could make several CSS files and include the one with correct colors PHP Code:
__________________
Fatal error on row 561: Couldn't access life - life isn't set |
|
#4
|
||||
|
||||
|
Quote:
besides using Kimppa's method, u can also try 2 override the div tag style using style attribute.... set the style attributes with the desired colour using php script... Last edited by tvc3mye : March 12th, 2004 at 11:29 AM. Reason: correction.... |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > changing css styles with php |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|