CSS background

Grafight

New Member
I'm new to this site and just started making my first website. I have my navigation menu already but I need help with the background. I want the middle of the background to be white with the outside of it to be blue and i can't figure out how to do it...help please?:confused:...i'm sure this is a really dumb question but if someone can help me out i would greatly appreciate it. thanks
 

TheLivingDead

New Member
I'm new to this site and just started making my first website. I have my navigation menu already but I need help with the background. I want the middle of the background to be white with the outside of it to be blue and i can't figure out how to do it...help please?:confused:...i'm sure this is a really dumb question but if someone can help me out i would greatly appreciate it. thanks


more info (?)

if your page set up with div tags, you could assign the background color for the inner div to white and the over all wrapper with a blue background...

link to your site?
 

dzwestwindsor

New Member
TheLivingDead +1,

but if you are going to have text run through both colors, then I would use a drawing tool and make a background, and save it as a .gif (which has the smallest file size for solid colors), and set as background for that one div. (instead of nested divs, which doesn't work if you are going to run the text through both colors)
 

smoovo

New Member
I want it to look something kinda like this website...except just different colors...http://css-tricks.com/multiple-backgrounds-left-half-and-right-half/ ...you see how it has a fixed page background...and then all the content has a white background...

Are you talking about the page layout or the menu? In your first post you talked about the menu, this example you posted is about the page layout :confused:, we all want to help you but you don't explaining your problem.

Provide:
1. Link to your website (yours).
2. Image attached to your post for what you are looking for (with Photoshop... etc.).

That way we will look into this and we'll come with answer. :)
 

Grafight

New Member
I'm saying for the overall background of the page...I don't have a website up yet i'm just designing it right now...idk if i'm saying it correctly but all i want is to have the background to be light blue with all the content on the page centered with a white background...i can't think of how else to explain it sorry
 

Grafight

New Member
i want something similar to the link that dzwestwindsor put in his reply...you can see how that background on that page has all those circles and designs while all the content is in a white background.
 

smoovo

New Member
OK.

The background will be configured in the body CSS
HTML:
body {background:url('image.jpg');}

If you want it to be fixed
HTML:
body {background:url('image.jpg'); background-attachment:fixed;}

The page (white container) will be a div with fixed width (lets say 900 pixels), and we want it to be centered.

The div will be configured
HTML:
#page {width:900px; background:#fff;}

To center it we should tell to the body to do it
HTML:
body {background:url('image.jpg'); background-attachment:fixed; text-align:center;}

And the page should be free
HTML:
#page {width:900px; background:#fff; margin:auto;}

and all together:
CSS
HTML:
body {background:url('image.jpg'); background-attachment:fixed; text-align:center;}
#page {width:900px; background:#fff; margin:auto;}

HTML
HTML:
<body>
<div id="page"></div>
</body>

You can custom it however you like. Adding border to the page sides, change width, etc...

- Enjoy, and good luck. :)
 
Last edited:
Top