...

View Full Version : CSS..How to change background on content area and not page background?



interlog
07-06-2007, 03:45 PM
Ok guys, im working on this website

http://ftp1.dns-systems.net/~msjonline/

As u can c it looks a bit too plain, lyk everything is floating everywhere..

i want to change the background colour, from the header down only, and keep the background of the page. i cant work out how to do this, my coder who did the css says it not possible...

want it to look like this:

http://smg.photobucket.com/albums/v289/desibady/?action=view&current=msjexample.jpg

Any help will be deeply appriciated. Thanks guys and girls!

BWiz
07-06-2007, 03:48 PM
All the stuff from the header down, such as the actual content [the links and the picture], you'll want to put into a separate <div>. Doing this, you can then set the background color using CSS to whichever color you want.

CaptainB
07-06-2007, 03:51 PM
Holy s***, that's a messy code!

EDIT: BWiz and I posted kinda the same time I see..

interlog
07-06-2007, 03:58 PM
All the stuff from the header down, such as the actual content [the links and the picture], you'll want to put into a separate <div>. Doing this, you can then set the background color using CSS to whichever color you want.

I duno if thats possible, as they are seperate div's already cuzz its linkd to the php code or something :S..dont quite understand CSS very well!

BWiz
07-06-2007, 04:00 PM
It doesn't matter, as long as the other <div>'s haven't got a background color set, you can wrap the entire thing in a <div> tag and set the background color. Of course, if the entire page is generated by PHP (which it shouldn't be, only data or text should be), you may have to tweak the PHP code a little bit.

interlog
07-06-2007, 04:09 PM
If i knew how to do that i would do it, my coder keeps insisting its not possible

interlog
07-06-2007, 04:16 PM
Oh yeh and it is generated by php

BWiz
07-06-2007, 04:17 PM
Type this just above the <table>,


<div id="bgColorFix">

Type this at just below the

"</table>
<div class="clear"></div>"


</div>

And place this inbetween the <head> tags



<style type="text/css">
<!--
div#bgColorFix { background-color: #999; }
-->
</style>


EDIT: The entire page? It is all generated by PHP??

interlog
07-06-2007, 04:22 PM
would i place that in toppage.php or the css?

BWiz
07-06-2007, 04:23 PM
Can you show the actual PHP which generates the page in question?

interlog
07-06-2007, 04:28 PM
How do i show it? sorry if i sound so inexp, im only 16 dude lol...

I get a headache wen i look at any sort of code, even html..


EDIT- Yeh its all php, i got a index, a top page and somthing els that i dnt really touch wen editing

BWiz
07-06-2007, 04:30 PM
How do i show it? sorry if i sound so inexp, im only 16 dude lol...

Well I'm fifteen, so not too much difference.

Do you know if it is just the content [ie, the text is generated by the PHP, or is all the code generated by the php as well.]

interlog
07-06-2007, 04:31 PM
Im pretty sure all the code is generated by php...Well most of it

BWiz
07-06-2007, 04:36 PM
Any change of showing the PHP code for the page in question.

Remember, if you connect to a SQL database, replace the password and username. In fact, if there's anything sensitive, just replace it with filler text.

interlog
07-06-2007, 04:39 PM
ermmMm thing is there are several php pages

BWiz
07-06-2007, 04:41 PM
Do you know which page generates the HTML in question? Ask your coder see of s/he knows.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum