Click to See Complete Forum and Search --> : Sides with different coloured backgrounds.


chaz2290
11-17-2009, 06:24 PM
This is the best example I can get of what I wish to achieve:
http://www.maqina.ro
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!

Cheers:)

Fang
11-18-2009, 01:56 AM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title></title>
<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;}
</style>

</head>
<body>
<h1>header text</h1>
</body>
</html>

chaz2290
11-18-2009, 08:32 AM
Ace, thanks! Works a treat :)

chaz2290
11-18-2009, 04:03 PM
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!