navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

help! setting up an 800 wide site centered

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> General Web Development >> help! setting up an 800 wide site centered
Page: [1]
 
Em

 

Posts: 39
Joined: 12/20/2001
From: Southeastern Oh USA
Status: offline

 
help! setting up an 800 wide site centered - 4/13/2008 13:30:55   
Ok, I'm STUCK!!

I'm missing the "how to" set up an 800 wide site that is centered on the browser page, and then has background on either side which collapses or expands based on the person's resolution size.

Do you just set this up in a table that has essentially 3 columns where the middle is set at 800 pixels, and the sides then have the background?

Seems so basic, but I can't find any info on how to exactly DO THIS.

THANKS for any input!!!

Em

_____________________________

Dancin' with waves.
rdouglass

 

Posts: 9269
From: Biddeford, ME USA
Status: offline

 
RE: help! setting up an 800 wide site centered - 4/13/2008 13:46:44   
I don't use tables for that. A liitle CSS like this...
body
{
	margin: 0;
}
#divContent
{
	width: 800px; margin: 0 auto;
}

...a little HTML like this...
<body>
<div id="divContent">
Blah, blah...
</div>
</body>


That's how I do it anyways. Hope it helps.

< Message edited by rdouglass -- 4/14/2008 9:01:32 >


_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to Em)
Tailslide

 

Posts: 6116
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: help! setting up an 800 wide site centered - 4/13/2008 14:00:56   
have the background image (which would be the left bit, central bit, right bit) slice and then repeat it on the body element like this:

body {background: url(images/background.jpg) center top repeat-y;}


as well as the stuff Roger's given you - that will repeat the sliced image down the centre of the page and will give the effect you're after.

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to rdouglass)
Tailslide

 

Posts: 6116
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: help! setting up an 800 wide site centered - 4/14/2008 2:24:26   
What you do is this.

Firstly - to get a fixed width site that will fit on a screen without horizontal scrollbars, the width of the actual site itself should be around 760px wide.

So create an image for your background that has a central area that is 760px wide (whatever background colour your actual content area should have. Then each side of that 760px wide area goes the actual background image. The best way to do this is have a smallish repeating pattern. Then save a strip of this as your background image. I've attached (a fairly horrible) example of what I mean.

Now on your actual HTML page you add a containing div - can be called anything you like, I'll call it container.

so you'll have:

(all the page head stuff here)
<body>
   <div id="container">
       (all the rest of the content go in here)
   </div> <!-- end container -->
</body>
</html>


Now in the stylesheet you do this:

body {background:#fff url(images/background.gif) top center repeat-y;text-align:center;}
#container {margin:0 auto; text-align:left; width:760px;}


That will make the div called container 760px wide and will centre it on top of the background image which will be repeated down the page.

Edit: Here's a TEST PAGE to show you how it works.


Thumbnail Image
:)

Attachment (1)

< Message edited by Tailslide -- 4/14/2008 2:32:54 >


_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to Tailslide)
Em

 

Posts: 39
Joined: 12/20/2001
From: Southeastern Oh USA
Status: offline

 
RE: help! setting up an 800 wide site centered - 4/14/2008 8:34:39   
Tailspin.. Thank you so much!!! I finally understand!!

So I'm curious... why drop the 800 down to 760??

And I'm assuming that if the sample you provided is viewed at 800, only 20 pixels of the background will show on each side? And when viewed at 1024 or greater, the background image will repeat to fill the space?

Thanks again!!

Em

(in reply to Tailslide)
Tailslide

 

Posts: 6116
Joined: 5/10/2005
From: Out here on the raggedy edge
Status: offline

 
RE: help! setting up an 800 wide site centered - 4/14/2008 9:08:01   
It's 760 because you need to allow for the vertical scrollbars etc - it's different on each browser but 760px will be fine on all of them.

The background image is repeating vertically down the page and will be as long as necessary.

Width-wise - It'll be whatever width you create - the example I've used is 1000px wide. If you create a very wide image then you end up eating bandwidth so best bet is to have something not too wide - maybe fade it into the background colour and then you get a seemless effect at any width. In the example posted the background colour is white:

body {background:#fff url etc etc.

so just change that as necessary

_____________________________

"My strategy is so simple an idiot could have devised it"
Little Blue Plane Web Design | Blood, Sweat & Rust - A Land Rover restoration project

(in reply to Em)
Page:   [1]

All Forums >> Web Development >> General Web Development >> help! setting up an 800 wide site centered
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts