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



Reply
Trouble centering page.
Old 08-30-2008, 01:21 PM Trouble centering page.
Skilled Talker

Posts: 90
Name: Ed
Trades: 0
I can't seem to figure out why my page won't center. I've tried many different ways of doing this and it won't budge from the left side of the screen. I have Layer4 wrapped around all my content in my code.

Last edited by mrflume; 09-03-2008 at 08:54 AM..
mrflume is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-30-2008, 01:25 PM Re: Trouble centering page.
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Did you try reading the stickies ????

Get rid of all that position:absolute - it causes lots of problems and it's totally unnecessary. Learn to use the normal document flow and floats and you'll be much better off.

The width: 100% on Layer4 is unnecessary. Set it to position: relative (the ONLY positioning you need) and it should center.
__________________
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
Reply With Quote
View Public Profile
 
Old 08-30-2008, 01:36 PM Re: Trouble centering page.
Skilled Talker

Posts: 90
Name: Ed
Trades: 0
Yeah I made sure to read through that first, but wasn't quite sure what was wrong with my code. Let me try what you suggested.
mrflume is offline
Reply With Quote
View Public Profile
 
Old 08-30-2008, 02:10 PM Re: Trouble centering page.
Skilled Talker

Posts: 90
Name: Ed
Trades: 0
ok so I no longer have any absolutely positioned elements on my page, they either have no positioning selected or they are relatively positioned. I still can't figure out why my "wrapper" which I was able to name it now, still isn't able to center my entire page. I have all my content between it. Doesn't make sense to me.

Last edited by mrflume; 09-03-2008 at 08:54 AM..
mrflume is offline
Reply With Quote
View Public Profile
 
Old 08-30-2008, 02:10 PM Re: Trouble centering page.
Valiant's Avatar
Super Talker

Posts: 112
Location: England
Trades: 0
IE is really buggy, I suggest you try the following:

Body:
body {
background-color: #000000;
padding: 0;
text-align: center;
margin: 0;
}

and then the thing you want to center (wrapper), add this:
text-align: left;
margin: 0 auto;

Hope that helps!

Last edited by Valiant; 08-30-2008 at 02:11 PM..
Valiant is offline
Reply With Quote
View Public Profile
 
Old 08-30-2008, 02:18 PM Re: Trouble centering page.
Skilled Talker

Posts: 90
Name: Ed
Trades: 0
I tried that and it's still not working.
mrflume is offline
Reply With Quote
View Public Profile
 
Old 08-30-2008, 02:22 PM Re: Trouble centering page.
Valiant's Avatar
Super Talker

Posts: 112
Location: England
Trades: 0
Post us what you have now you;ve added the codes I posted.
Valiant is offline
Reply With Quote
View Public Profile
 
Old 08-30-2008, 02:29 PM Re: Trouble centering page.
Skilled Talker

Posts: 90
Name: Ed
Trades: 0
here it is

Last edited by mrflume; 09-03-2008 at 08:54 AM..
mrflume is offline
Reply With Quote
View Public Profile
 
Old 08-30-2008, 02:33 PM Re: Trouble centering page.
Valiant's Avatar
Super Talker

Posts: 112
Location: England
Trades: 0
because you still have margin left and right on it, make the wrapper:

#wrapper {

text-align: left;
margin: 0 auto;
}
Valiant is offline
Reply With Quote
View Public Profile
 
Old 08-30-2008, 02:36 PM Re: Trouble centering page.
Skilled Talker

Posts: 90
Name: Ed
Trades: 0
Ok I did that still a no go. Is their anything more I can do to help you help me figure this out? would you need screenshots of dreamweaver? or is it possible to just figure it out from the code.

Last edited by mrflume; 09-03-2008 at 08:55 AM..
mrflume is offline
Reply With Quote
View Public Profile
 
Old 08-30-2008, 02:48 PM Re: Trouble centering page.
Valiant's Avatar
Super Talker

Posts: 112
Location: England
Trades: 0
Send in a screen shot.
Valiant is offline
Reply With Quote
View Public Profile
 
Old 08-30-2008, 02:54 PM Re: Trouble centering page.
Valiant's Avatar
Super Talker

Posts: 112
Location: England
Trades: 0
Wait, you need to set the width of the wrapper. Sorry!
Valiant is offline
Reply With Quote
View Public Profile
 
Old 08-30-2008, 03:00 PM Re: Trouble centering page.
Skilled Talker

Posts: 90
Name: Ed
Trades: 0
will do. ill send one in at some point today.
mrflume is offline
Reply With Quote
View Public Profile
 
Old 08-30-2008, 03:09 PM Re: Trouble centering page.
Valiant's Avatar
Super Talker

Posts: 112
Location: England
Trades: 0
I dont think you will need one if you set the width of the wrapper, that should work.
Valiant is offline
Reply With Quote
View Public Profile
 
Old 08-30-2008, 04:47 PM Re: Trouble centering page.
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Look, you're missing THE most important rule - if you want it to center using margin: 0 auto; you MUST give the #wrapper a DEFINED WIDTH!
__________________
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
Reply With Quote
View Public Profile
 
Old 08-30-2008, 10:16 PM Re: Trouble centering page.
Skilled Talker

Posts: 90
Name: Ed
Trades: 0
hey thanks for the assistance.

Last edited by mrflume; 09-03-2008 at 08:55 AM..
mrflume is offline
Reply With Quote
View Public Profile
 
Old 08-31-2008, 08:08 AM Re: Trouble centering page.
Valiant's Avatar
Super Talker

Posts: 112
Location: England
Trades: 0
Pleased to help.
Valiant is offline
Reply With Quote
View Public Profile
 
Old 09-01-2008, 06:33 AM Re: Trouble centering page.
Banned

Posts: 52
Name: Dang N
Location: Rowlett Tx
Trades: 0
lol take away the " position: relative "
Dangmnx is offline
Reply With Quote
View Public Profile Visit Dangmnx's homepage!
 
Old 09-01-2008, 10:58 AM Re: Trouble centering page.
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
The position:relative on the #wrapper is harmless and also a good idea. Should the OP decide to position something INSIDE the #wrapper, it would be positioned relative to the #wrapper rather than the body.
__________________
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
Reply With Quote
View Public Profile
 
Old 09-01-2008, 04:05 PM Re: Trouble centering page.
Skilled Talker

Posts: 90
Name: Ed
Trades: 0
thanks for the info, ladynred. Is their anything about my code that you would do differently or any other suggestions?
mrflume is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Trouble centering page.
 

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 1.06175 seconds with 12 queries