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
Problem with css center
Old 07-08-2009, 10:56 AM Problem with css center
konetch's Avatar
Ultra Talker

Posts: 258
Trades: 0
I have created a container that will be centered on the page the css I have for it is.

Code:
#body {
 width:1000px;
 padding:20px;
 margin-top: 30px;
 background: #fff;
 margin-right:auto;
 margin-left:auto;
}
I'm not sure why, but it works fine in chrome and firefox, but
not in IE. anybody know why. Thanks
__________________
Alex
konetch is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-08-2009, 01:33 PM Re: Problem with css center
angele803's Avatar
Perfectly Imperfect

Posts: 1,772
Name: Stephanie
Location: Oklahoma
Trades: 2
It looks okay to me. I made a quick html document and tried it out and it worked in IE7. Can you post the rest of the code or a link? Maybe it is a problem in a surrounding element???
__________________

Please login or register to view this content. Registration is FREE
angele803 is offline
Reply With Quote
View Public Profile
 
Old 07-08-2009, 02:53 PM Re: Problem with css center
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
What VERSION of IE ?? If it's anything older than IE6 or your IE6 is not fully patched, then you will have to add text-align: center; to the <body> to make it center the #body wrapper.
__________________
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 07-08-2009, 05:36 PM Re: Problem with css center
konetch's Avatar
Ultra Talker

Posts: 258
Trades: 0
LadynRed. I'd knew you would come along!

That worked great. I'm using IE 7 so I'm not sure what the problem was. I had

Code:
html { text-align:center }
but I guess this wouldn't help.

Thanks
__________________
Alex
konetch is offline
Reply With Quote
View Public Profile
 
Old 07-08-2009, 07:41 PM Re: Problem with css center
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
In IE7, using margin: XX auto; on the div you want to center will center horizontally.
__________________
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
 
Reply     « Reply to Problem with css center
 

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