Results 1 to 4 of 4

Thread: Sides with different coloured backgrounds.

  1. #1
    Join Date
    Nov 2009
    UK, Lancs

    Sides with different coloured backgrounds.

    This is the best example I can get of what I wish to achieve:
    Now, there is a main background which is a light grey with a second white background on top of it.
    I can only assume this is done using CSS.

    I have had a go at doing something like this but can't!
    This particular website also shows some back ground at the top, but I only really want to know how to show it at the sides.

    I've tried using div tags then adding a margin but it's hard to know how much of a margin to have, plus this means there has to be text for the background colour to show for some reason.

    I want to make websites by having a header and everything on the outside of the header to be a different colour. I can do this using frames or AP divs but...it's hardly good practice

    Help please!


  2. #2
    Join Date
    Apr 2003
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <style type="text/css">
    * {margin:0;padding:0;}
    html {background-color:#ddd;padding:2em;}
    body {background-color:#fff;}
    <h1>header text</h1>
    At least 98% of internet users' DNA is identical to that of chimpanzees

  3. #3
    Join Date
    Nov 2009
    UK, Lancs
    Ace, thanks! Works a treat

  4. #4
    Join Date
    Nov 2009
    UK, Lancs
    ey up sorry, it didn't fully work.
    I have a title image that will be centered at the top of the page, I want anything at the side of the title and down from there (like a column at each side) so be a different colour (grey).

    Is there some kind of way to put the image in maybe a div then have padding but JUST on the sides.

    Sorry, I'll try and find an example...it's something I see all the time but can't find anything now...typical!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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