Reply
How To Center Your Website
Old 01-30-2008, 03:26 PM How To Center Your Website
LadynRed's Avatar
Super Moderator

Posts: 6,019
Location: Tennessee
With CSS solutions of course. This question comes up constantly, so here are links to several resources specific to this issue:

HORIZONTAL CENTERING
http://www.maxdesign.com.au/presentation/center/
http://bluerobot.com/web/css/center1.html
http://www.simplebits.com/notebook/2...centering.html
http://www.andybudd.com/archives/200...ntering_a_div/
http://css-discuss.incutio.com/?page...ngBlockElement
http://allmyfaqs.net/faq.pl?Center_with_CSS


VERTICAL CENTERING

http://www.hicksdesign.co.uk/journal...ering-with-css
http://www.jakpsatweb.cz/css/css-ver...-solution.html
http://tutorials.alsacreations.com/centrer/
__________________
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
 
When You Register, These Ads Go Away!
     
Old 02-29-2008, 08:36 AM Re: How To Center Your Website
dougadam's Avatar
Ultra Talker

Latest Blog Post:
Bloom Where You Are
Posts: 328
Name: Douglas Adams
Location: Kalkaska Michigan
I have often been in need of this information.
Thanks
dougadam is offline
Reply With Quote
View Public Profile Visit dougadam's homepage!
 
Old 02-29-2008, 09:04 AM Re: How To Center Your Website
Webmaster Talker

Posts: 551
Name: Barry O' Brien
Location: Ireland
or simply use this

}
#container {
margin:0 auto;
width:860px;
bottom:0;
}
audiomad is offline
Reply With Quote
View Public Profile Visit audiomad's homepage!
 
Old 02-29-2008, 02:32 PM Re: How To Center Your Website
LadynRed's Avatar
Super Moderator

Posts: 6,019
Location: Tennessee
It's not ALWAYS that simple.. and as you can see if you read the articles, there are many different solutions.
__________________
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 03-26-2008, 09:32 AM Re: How To Center Your Website
pothi's Avatar
Novice Talker

Posts: 5
Name: Pothi Kalimuthu
Location: India
Hi,

I'm new to webdesign. I've done horizontal centering for a small website. I was scratching my head for vertical in combination with horizontal centering. Your links have been useful to me.

Thanks a lot.
pothi is offline
Reply With Quote
View Public Profile
 
Old 03-28-2008, 12:01 PM Re: How To Center Your Website
Extreme Talker

Posts: 185
Thank you.

Some of those were quite hard to follow but I found this one the easiest for centering a DIV in the middle of a page - horizontal and vertical.
__________________
JF Web Design
Joe3000 is offline
Reply With Quote
View Public Profile
 
Old 04-10-2008, 03:28 PM Re: How To Center Your Website
Average Talker

Posts: 19
Quote:
Originally Posted by audiomad View Post
or simply use this

}
#container {
margin:0 auto;
width:860px;
bottom:0;
}
Quote:
Originally Posted by LadynRed View Post
It's not ALWAYS that simple.. and as you can see if you read the articles, there are many different solutions.
Actually it is simple if you use that method in conbination with the right DOCTYPE. For instance, the following won't work:
HTML Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
But this will:
HTML Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
And of course, the stylesheet:
HTML Code:
#container {
 margin: 0 auto;
 width: 960px;
 }
__________________
WebdesignGold.com
Web Design Resources
WebdesignGold is offline
Reply With Quote
View Public Profile Visit WebdesignGold's homepage!
 
Old 04-10-2008, 06:16 PM Re: How To Center Your Website
Gilligan's Avatar
Dead Like Me

Posts: 1,572
Name: Stefan
Location: London, UK
But still, she said

"its not ALWAYS"

meaning most of the time it will work.
Gilligan is offline
Reply With Quote
View Public Profile
 
Old 04-11-2008, 10:34 AM Re: How To Center Your Website
LadynRed's Avatar
Super Moderator

Posts: 6,019
Location: Tennessee
IMO, if you're using a Transitional doctype with LOOSE, you're just being a lazy coder and not doing your audience any favors.
__________________
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 05-08-2008, 11:33 AM Re: How To Center Your Website
Novice Talker

Posts: 4
Name: John Rosa
thanks again
RosaJ82 is offline
Reply With Quote
View Public Profile
 
Old 05-09-2008, 08:17 AM Re: How To Center Your Website
sfpavel's Avatar
Experienced Talker

Posts: 35
Name: Razvan Pavel
Location: Bucharest, Romania
thnx a lot. no more googleing on how to center bloody divs
sfpavel is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How To Center Your 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.14991 seconds with 13 queries