When I run my script I noticed that my background color wasn't there
and then when I displayed the css file, I saw that the values were not
getting picked up.
__________________
If you want to attract and keep more clients, then offer great customer support.
Support-Focus.com. automates the process and gives you a trust seal to place on your website.
I recommend that you at least take the 30 day free trial.
It is a totally separate file that is loaded independently and has no way of grabbing variables that are defined in another file. You'll need to move the variables to a file that is included in both.
^ this.
Look at how you get it into the site: <link rel='stylesheet' type='text/css' href='a_style.php' >. This is a client side fetch, not a server side one. PHP and the webserver has done its job already, and sent the HTML to the client. The client then sees the external href for the stylesheet and requests that the server provides a_style.php.
So as mentioned, completely independent requests.
otherwise it will use the version in the browsers' cache.
But why bother? That's what classes, ids, etc., are for??
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS
Last edited by AndrewGSW; 01-18-2013 at 07:45 PM..
__________________
If you want to attract and keep more clients, then offer great customer support.
Support-Focus.com. automates the process and gives you a trust seal to place on your website.
I recommend that you at least take the 30 day free trial.
Well, that's one way. But if you had enough classes and ids to choose between (when constructing the HTML) then you wouldn't need to use PHP variables in your css?! Just apply different class-names as you build the page.
If you wanted to apply one of two different sets of CSS rules then you could use PHP to attach one .css file or the other to the page.
I don't see the need to embed PHP in a css file . To me, it adds an unnecessary level of complexity.
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS
The problem is that your code in the "a_style.php" doesn't define the PHP variables before using them. The adjustment I have made below shows you where you need the extra code to get the styles to work.
Possibly the only change you need is to move the include for the file that manipulates the values form the DB to include into the styles from the PHP file generating the HTML into the PHP file generating the CSS.
The php variables seem to have got through,
but are not getting applied.
Can anyone see what I did wrong ??
Thanks.
.
__________________
If you want to attract and keep more clients, then offer great customer support.
Support-Focus.com. automates the process and gives you a trust seal to place on your website.
I recommend that you at least take the 30 day free trial.
Clear your browsers cache. This is why you need to apply a query-string variable to your css-link.
Edited: Oh I see you've added an internal stylesheet. However, clearing the browser cache always good when testing.
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS
You are suffering div-collapse because your DIV only contains floated elements. That is, its height is collapsing to 0, which is why you don't see the background colour. Look at Collapsing on this page.
Code:
#mainC {
margin: 0px auto;
overflow: hidden;
}
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS
Last edited by AndrewGSW; 01-18-2013 at 08:48 PM..
__________________
If you want to attract and keep more clients, then offer great customer support.
Support-Focus.com. automates the process and gives you a trust seal to place on your website.
I recommend that you at least take the 30 day free trial.