Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Closed Thread
How To Center Your Website
Old 01-30-2008, 03:26 PM How To Center Your Website
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
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
If you have new resources, PM me and I'll add them, this thread is now locked
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 !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Last edited by LadynRed; 09-13-2008 at 11:48 AM..
LadynRed is offline
View Public Profile
 
 
Register now for full access!
Old 02-29-2008, 08:36 AM Re: How To Center Your Website
dougadam's Avatar
The Watkins Man

Latest Blog Post:
Bloom Where You Are
Posts: 359
Name: Douglas Adams
Location: Traverse City, Michigan
Trades: 0
I have often been in need of this information.
Thanks
__________________

Please login or register to view this content. Registration is FREE
indpassoc |
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
indpassoc
dougadam is offline
View Public Profile Visit dougadam's homepage!
 
Old 02-29-2008, 09:04 AM Re: How To Center Your Website
Super Spam Talker

Posts: 755
Name: Barry O' Brien
Location: Ireland
Trades: 0
or simply use this

}
#container {
margin:0 auto;
width:860px;
bottom:0;
}
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
audiomad is offline
View Public Profile Visit audiomad's homepage!
 
Old 02-29-2008, 02:32 PM Re: How To Center Your Website
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
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 !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
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
Trades: 0
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
View Public Profile Visit pothi's homepage!
 
Old 03-28-2008, 12:01 PM Re: How To Center Your Website
Ultra Talker

Posts: 316
Trades: 0
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.
Joe3000 is offline
View Public Profile
 
Old 04-10-2008, 03:28 PM Re: How To Center Your Website
Average Talker

Posts: 19
Trades: 0
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;
 }
__________________

Please login or register to view this content. Registration is FREE

Web Design Resources
WebdesignGold is offline
View Public Profile Visit WebdesignGold's homepage!
 
Old 04-10-2008, 06:16 PM Re: How To Center Your Website
Gilligan's Avatar
Website Designer

Posts: 1,670
Name: Stefan
Location: London, UK
Trades: 0
But still, she said

"its not ALWAYS"

meaning most of the time it will work.
__________________

Please login or register to view this content. Registration is FREE
Gilligan is offline
View Public Profile
 
Old 04-11-2008, 10:34 AM Re: How To Center Your Website
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
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 !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
View Public Profile
 
Old 05-08-2008, 11:33 AM Re: How To Center Your Website
Novice Talker

Posts: 4
Name: John Rosa
Trades: 0
thanks again
RosaJ82 is offline
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
Trades: 0
thnx a lot. no more googleing on how to center bloody divs
sfpavel is offline
View Public Profile
 
Old 07-25-2008, 04:01 AM Re: How To Center Your Website
abhi's Avatar
Super Talker

Posts: 100
Name: abhishek
Location: mauritius
Trades: 0
very useful things. I have already make used of one of the guide.
__________________

Please login or register to view this content. Registration is FREE
Visit Mauritius Island for your holidays!
Please login or register to view this content. Registration is FREE
abhi is offline
View Public Profile Visit abhi's homepage!
 
Old 07-29-2008, 08:59 AM Re: How To Center Your Website
Skilled Talker

Posts: 85
Name: murali
Trades: 0
its useful to me .. thanks a lot ...do share more of this kind.. useful for webdesigners like me
__________________
Network @
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
umurali2000 is offline
View Public Profile Visit umurali2000's homepage!
 
Old 08-24-2008, 03:25 PM Re: How To Center Your Website
Novice Talker

Posts: 10
Name: John Meen
Trades: 0
niceee thanks!
dev114 is offline
View Public Profile
 
Old 08-25-2008, 11:12 AM Re: How To Center Your Website
Experienced Talker

Posts: 33
Name: Toby Osbourn
Trades: 0
Very handy, cheers.
tosbourn is offline
View Public Profile
 
Old 08-26-2008, 03:26 AM Re: How To Center Your Website
thurrz's Avatar
Skilled Talker

Posts: 92
Trades: 0
Thanks
Before my site used to a problems regarding centering of divs
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
thurrz is offline
View Public Profile
 
Old 08-30-2008, 06:17 AM Re: How To Center Your Website
Super Talker

Posts: 102
Trades: 0
Hello,
You can use this code
#content {
width: 700px ;
margin-left: auto ;
margin-right: auto ;
}
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
John_audson is offline
View Public Profile
 
Old 09-05-2008, 02:14 AM Re: How To Center Your Website
Average Talker

Posts: 20
Trades: 0
Quote:
Quote:
Originally Posted by audiomad
or simply use this

}
#container {
margin:0 auto;
width:860px;
bottom:0;
}
Quote:
Originally Posted by LadynRed
It's not ALWAYS that simple.. and as you can see if you read the articles, there are many different solutions.

Isn't that like all you neeed?... It's the only one I know, and has never failed me. XP
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
zerodash is offline
View Public Profile Visit zerodash's homepage!
 
Old 09-05-2008, 09:11 AM Re: How To Center Your Website
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
As I stated, there are many solutions depending on what you're trying to accomplish and how your layout is done. Most of the time the margin:0 auto with a width is all that's needed to horizontally center a layout. Some people want to center vertically too, and others who use absolute positioning for everything may not be able to use this simple solution. So.. it depends!
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
View Public Profile
 
Old 09-06-2008, 04:27 PM Re: How To Center Your Website
dietcorenet's Avatar
Novice Talker

Posts: 8
Name: Terry
Location: San Diego
Trades: 0
Wow!
Nothing like a little bit of information to make the light bulb come on!

Thanks
__________________
Terry

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
dietcorenet is offline
View Public Profile
 
Closed Thread     « Reply to How To Center Your Website
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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.55170 seconds with 11 queries