Reply
Whats the easiet way to 'center' a website
Old 04-17-2007, 05:10 PM Whats the easiet way to 'center' a website
Experienced Talker

Posts: 45
www.hissmedia.com

Is there an easy way to center this site. If you could, please work with my code, i know its horrible. I created the site and am having my buddy (html expert) look through it in a week or so.

Thanks.

Last edited by crj900 : 04-17-2007 at 05:21 PM.
crj900 is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 04-17-2007, 06:33 PM Re: Whats the easiet way to 'center' a website
LadynRed's Avatar
Super Moderator

Posts: 5,973
Location: Tennessee
Did that in Dreamweaver WYSIWYG mode right ??

All those absolutely positioned "layers" (they are NOT LAYERS !) are not necessary and they are big trouble. Hopefully your 'html expert' knows that and can straighten it out.

You've got <div id="layer1"> twice - can't do that, ID's must be UNIQUE !

At this point, with that setup:
Add a #wrapper div to contain everything else and give it a width.
In the CSS:
#wrapper{
width: 785px;
position: relative;
margin: 0 auto;
text-align: left;
}

On the body add this:
body{
text-align: center;
}

You need both in order to center in all the good browsers and the 'text-align:center" to make IE6 and below center.

I would highly suggest using Floats for that layout and get rid of all the position: absolute.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 04-17-2007, 11:48 PM Re: Whats the easiet way to 'center' a website
Experienced Talker

Posts: 45
Im a little confused. If I delete all of my layers, and replace it with that one, how would my images/text know where to go?
crj900 is offline
Reply With Quote
View Public Profile
 
Old 04-18-2007, 03:37 AM Re: Whats the easiet way to 'center' a website
Super Talker

Posts: 121
Name: Ared
it will have a problem.. you must check all the previous code before applying that..
Ar3d is offline
Reply With Quote
View Public Profile
 
Old 04-18-2007, 03:59 AM Re: Whats the easiet way to 'center' a website
Webmaster Talker

Posts: 548
Name: Barry O' Brien
Location: Ireland
I use dream weaver having 10% margins on both sides
audiomad is online now
Reply With Quote
View Public Profile Visit audiomad's homepage!
 
Old 04-18-2007, 05:06 AM Re: Whats the easiet way to 'center' a website
BruceWayne's Avatar
Extreme Talker

Posts: 182
The page is on center now, anyway, you got a nice site !
BruceWayne is offline
Reply With Quote
View Public Profile Visit BruceWayne's homepage!
 
Old 04-18-2007, 11:20 AM Re: Whats the easiet way to 'center' a website
LadynRed's Avatar
Super Moderator

Posts: 5,973
Location: Tennessee
Quote:
If I delete all of my layers, and replace it with that one, how would my images/text know where to go?
I never said ANYTHING about deleting your "layers" ! I told you to ADD a div named #wrapper and put it AROUND what you already have.

That means:
<div id="#wrapper">
blah blah blah - the rest of your layout
</div> <!--end wrapper -->

Getting rid of 'position:absolute' does NOT mean deleting, it means using floats and the normal document flow to lay out your page.

No, it's not centered - it's too far to the right to be actually centered.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 04-18-2007, 02:24 PM Re: Whats the easiet way to 'center' a website
Webmaster Talker

Posts: 548
Name: Barry O' Brien
Location: Ireland
I also found that having three layers left and right layers at 25% width and the center 50%
audiomad is online now
Reply With Quote
View Public Profile Visit audiomad's homepage!
 
Reply     « Reply to Whats the easiet way to 'center' a website
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13771 seconds with 13 queries