|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
writing a php statement to change a css style
I have a header.inc file and a footer.inc file that is called to each new file that I create.
The header.inc file holds all the javascripts as well as calls the css, etc. It also begins the body and the footer.inc file closes the body. In other words in each new file that I create I have a php statement calling the header, and at the bottom of the file another statement that calls the footer. So each new file is really only part of the body as the title and head are found in the header.inc file. What I would like to do is be able to change the background color of the body of a new file if I choose to do so. But obviously because each new file is only part of the body I cannot put a css style in the new file. Is there any way of writing a php statement that I can place in a new file that would allow me to change the background-color of let's say #faunabody for that particular page??. Hope this is clear...thanks alot |
|
#2
|
||||
|
||||
|
You can use different CSS for each variety i.e. if (this) then { that.css } etc. It can be done with JavaScript or PHP
You can also output simple style tags for that one that you want. They would override the previous ones if they appear AFTER the call to the CSS and before </head> Example: Code:
<!-- javascript stuff here -->
<style type="text/css">
<!--
#faunabody { background: #ffffff; }
-->
</style>
</head>
<body>
This is more a HTML/CSS question that PHP. You only use PHP to output the HTML. Good luck ![]()
__________________
© AZ AZbb :: AZ Bulletin Board - Secure BBS script, Front page CMS, Chat, No database Simple Guide to Apache and PHP installation on Windows |
|
#3
|
||||
|
||||
|
why would you want to go through all that trouble just to do that. just simple put <body bgcolor="#000000">
__________________
"In a way, we're dead already" |
|
#4
|
|||
|
|||
|
Maybe you could use
page: PHP Code:
header.inc: PHP Code:
|
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > writing a php statement to change a css style |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|