Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    New Coder
    Join Date
    Jul 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CSS..How to change background on content area and not page background?

    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/v2...msjexample.jpg

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

  • #2
    Regular Coder BWiz's Avatar
    Join Date
    Mar 2006
    Location
    Sol System
    Posts
    471
    Thanks
    7
    Thanked 21 Times in 21 Posts
    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.
    BWiz :: Happy Coding!
    2006
    2007 2008 2009
    2010 2011
    Irrational numbers make no sense.

  • #3
    Regular Coder
    Join Date
    Jun 2007
    Posts
    805
    Thanks
    123
    Thanked 23 Times in 23 Posts
    Holy s***, that's a messy code!

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

  • #4
    New Coder
    Join Date
    Jul 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by BWiz View Post
    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!

  • #5
    Regular Coder BWiz's Avatar
    Join Date
    Mar 2006
    Location
    Sol System
    Posts
    471
    Thanks
    7
    Thanked 21 Times in 21 Posts
    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.
    BWiz :: Happy Coding!
    2006
    2007 2008 2009
    2010 2011
    Irrational numbers make no sense.

  • #6
    New Coder
    Join Date
    Jul 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If i knew how to do that i would do it, my coder keeps insisting its not possible

  • #7
    New Coder
    Join Date
    Jul 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Oh yeh and it is generated by php

  • #8
    Regular Coder BWiz's Avatar
    Join Date
    Mar 2006
    Location
    Sol System
    Posts
    471
    Thanks
    7
    Thanked 21 Times in 21 Posts
    Type this just above the <table>,

    Code:
    <div id="bgColorFix">
    Type this at just below the

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

    Code:
    </div>
    And place this inbetween the <head> tags

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

    EDIT: The entire page? It is all generated by PHP??
    Last edited by BWiz; 07-06-2007 at 05:23 PM.
    BWiz :: Happy Coding!
    2006
    2007 2008 2009
    2010 2011
    Irrational numbers make no sense.

  • #9
    New Coder
    Join Date
    Jul 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    would i place that in toppage.php or the css?

  • #10
    Regular Coder BWiz's Avatar
    Join Date
    Mar 2006
    Location
    Sol System
    Posts
    471
    Thanks
    7
    Thanked 21 Times in 21 Posts
    Can you show the actual PHP which generates the page in question?
    BWiz :: Happy Coding!
    2006
    2007 2008 2009
    2010 2011
    Irrational numbers make no sense.

  • #11
    New Coder
    Join Date
    Jul 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #12
    Regular Coder BWiz's Avatar
    Join Date
    Mar 2006
    Location
    Sol System
    Posts
    471
    Thanks
    7
    Thanked 21 Times in 21 Posts
    Quote Originally Posted by interlog View Post
    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.]
    BWiz :: Happy Coding!
    2006
    2007 2008 2009
    2010 2011
    Irrational numbers make no sense.

  • #13
    New Coder
    Join Date
    Jul 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Im pretty sure all the code is generated by php...Well most of it

  • #14
    Regular Coder BWiz's Avatar
    Join Date
    Mar 2006
    Location
    Sol System
    Posts
    471
    Thanks
    7
    Thanked 21 Times in 21 Posts
    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.
    BWiz :: Happy Coding!
    2006
    2007 2008 2009
    2010 2011
    Irrational numbers make no sense.

  • #15
    New Coder
    Join Date
    Jul 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ermmMm thing is there are several php pages


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •