If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

^ 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.

PHP Code:

header('HTTP/1.1 420 Enhance Your Calm');

Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

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.

PHP Code:

<?php header("Content-type: text/css; charset: UTF-8");

// set values here or place these in an include$body_font = '';$body_bk_col = '';

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.

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;
}

Last edited by AndrewGSW; 01-18-2013 at 09:48 PM.

"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