Smith
Smith

Reputation: 5961

changing html lay out with css using php

i have a basic two column webpage i did with css. it includes a header,footer,sidebar and bodycontent.

i'd like to generate css attached to the document dynamically so it will change the arrangement and color.

if i open the page with urlencoded values like page color, body color, sidebar position(left or right).

i can do this manually, by changing css values, but i want php to do it for me

how do i go it? is there any simple framework for this

Upvotes: 2

Views: 138

Answers (1)

Josh K
Josh K

Reputation: 28883

I would store any cross layout similar styles in an external style sheet and then say:

<style type="text/css">
    body
    {
        background: <?php echo $bgcolor; ?>;
    }

    #wrapper
    {
        margin: 0 auto;
        width: <?php echo $wrapper_width; ?>;
    }
</style>

Upvotes: 2

Related Questions