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
Old 10-16-2007, 03:08 PM centering HEELP
dansgalaxy's Avatar
Defies a Status

Posts: 6,522
Name: Dan
Location: Swindon
Trades: 0
ok.

i want a centerd div which is my wrapper with everything in fixed width

Ok i found a fix in which makes it centerd in safari and firefox and probably all non-IE browsers which is to use this:

Code:
#wrapper {
width: 790px;
background: #fff;
position: relative;
left: 50%;
margin-left: -395px; /* half the width of the div */
}
However... in IE7 (not sure about six havnt tested)

it ends up somewhere over there ----------------------------->

BUT if i put this:
Code:
#wrapper {
width: 790px;
background: #fff;
position: relative;

margin-left: 50% -395px; /* half the width of the div */
}
it works fine in IE

but in all others it ends up over there ------------------------------->

Yet IE will centre it with just a text-align: center in my body (which i have)

So how do i make a code which works well for both?
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
 
Register now for full access!
Old 10-16-2007, 03:18 PM Re: centering HEELP
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
In all compliant browsers with a fixed-width div, all you really need to do is this to make it center:
#wrapper{
width: 790px;
margin: 0 auto; }

For older versions of IE though you have to have text-align: center on 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 10-16-2007, 03:44 PM Re: centering HEELP
dansgalaxy's Avatar
Defies a Status

Posts: 6,522
Name: Dan
Location: Swindon
Trades: 0
I knew you would be first to answer this

Go LadyNRed Go LadyNRed... uuh uh its your birthday


Have some TP i havent been giving any out in the last few days

Dan
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Old 10-16-2007, 03:46 PM Re: centering HEELP
dansgalaxy's Avatar
Defies a Status

Posts: 6,522
Name: Dan
Location: Swindon
Trades: 0
O **** it!
you see this is what i get when im nice!! I just boosted you ahead of me! >< i was 6th last time i checked now im 8th and i would be 7th if i hadnt have given you that XD

O well You deserve it at least

Dan
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Old 10-16-2007, 03:53 PM Re: centering HEELP
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
LOL -- you're welcome
__________________
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 10-16-2007, 04:05 PM Re: centering HEELP
dansgalaxy's Avatar
Defies a Status

Posts: 6,522
Name: Dan
Location: Swindon
Trades: 0
This is why i like giving to the little guys... Lol
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Reply     « Reply to centering HEELP
 

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