Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-24-2012, 10:16 PM   PM User | #1
Webbabe
New to the CF scene

 
Join Date: Oct 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Webbabe is an unknown quantity at this point
Can Someone Please Help Me out!! Anyone:D

I am a so bad a coding. I know just a little and the one thing that has been hunting me as got me big time. For the love of god I can't seem to center my site. At all! When I get it centered on one computer and I go to the next, its not. Can someone please help me?? I would love it!!!
Webbabe is offline   Reply With Quote
Old 10-24-2012, 10:25 PM   PM User | #2
aaronhockey_09
Regular Coder

 
Join Date: Dec 2010
Posts: 411
Thanks: 21
Thanked 55 Times in 55 Posts
aaronhockey_09 is an unknown quantity at this point
Hey, i would need to see your code.
But you just need to do

Code:
margin:0 auto;
on the the div wrapping your page / content

can you post like or code
thanks
aaronhockey_09 is offline   Reply With Quote
Old 10-25-2012, 04:25 AM   PM User | #3
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Hello Webbabe,
To center an element you need three things:
  1. a valid DocType
  2. an element with a width
  3. that elements right/left margins set to auto
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Old 10-25-2012, 07:45 AM   PM User | #4
davikerkrish
New Coder

 
Join Date: Oct 2012
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
davikerkrish is an unknown quantity at this point
You need to ensure that the margin of body element must be 0 or auto.
davikerkrish is offline   Reply With Quote
Reply

Bookmarks

Tags
center, centering, coding, site, website

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 11:36 PM.


Advertisement
Log in to turn off these ads.