Reply
Centering DIVs?
Old 05-25-2007, 07:00 AM Re: Centering DIVs?
taketherisk's Avatar
Skilled Talker

Posts: 88
Name: Brett
Location: New Zealand
#wrapper {
text-align : center;
margin: 0px auto;
width: 760px;
}
#wrapper {
margin: 0px auto;
width: 760px;
}

Both do exactly the same, text-align: center; on the #wrapper does not center align text inside the other divs. Otherwise having text-align: center; on the body would center text for everything.
__________________
My Sites:
Free Domain Names
Free Web Hosting
taketherisk is offline
Reply With Quote
View Public Profile
 
Old 05-25-2007, 10:32 AM Re: Centering DIVs?
LadynRed's Avatar
Super Moderator

Posts: 6,559
Location: Tennessee
Quote:
#wrapper does not center align text inside the other divs.
Yes, it does, otherwise you wouldn't need to add text-align: left on everything inside the #wrapper, which you DID do. For NON-IE browsers, it's the margin: 0 auto; that centers the #wrapper.


Quote:
Otherwise having text-align: center; on the body would center text for everything.
It DOES ! That is why adding text-align:left to the #wrapper is necessary to correct the rule on the body for IE !
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 05-25-2007, 07:03 PM Re: Centering DIVs?
taketherisk's Avatar
Skilled Talker

Posts: 88
Name: Brett
Location: New Zealand
> see below.
__________________
My Sites:
Free Domain Names
Free Web Hosting

Last edited by taketherisk : 05-25-2007 at 07:11 PM.
taketherisk is offline
Reply With Quote
View Public Profile
 
Old 05-25-2007, 07:10 PM Re: Centering DIVs?
taketherisk's Avatar
Skilled Talker

Posts: 88
Name: Brett
Location: New Zealand
Ohh i didn't realise there were text-align : left; on them.

I didn't write that:
text-align : left;
If i did it would of looked like:
text-align: left;

Anyway this person wanted it to work, they don't care about that, this works with like 200 bytes more code, get over it already. I go to the trouble to actually do the coding and all you do is sit back and criticize.

I made a quick job of this, just fixing up their code to work on all browsers, not going through the whole code and pick out every little thing that doesn't need to be there.

Anyway thats where i stand.
__________________
My Sites:
Free Domain Names
Free Web Hosting
taketherisk is offline
Reply With Quote
View Public Profile
 
Old 05-25-2007, 08:01 PM Re: Centering DIVs?
LadynRed's Avatar
Super Moderator

Posts: 6,559
Location: Tennessee
Quote:
I go to the trouble to actually do the coding and all you do is sit back and criticize.
I beg your pardon, I make my living building web sites and I use CSS exclusively, so I DO know what I'm talking about. For people learning, they need to learn the correct way and they need to learn WHY things are done the way they are. I posted the correct code needed.

W3C Spec says:

Quote:
16.2 Alignment: the 'text-align' property

'text-align' Value: left | right | center | justify | inherit

Initial:
a nameless value that acts as 'left' if 'direction' is 'ltr', 'right' if 'direction' is 'rtl' Applies to: block-level elements, table cells and inline blocks Inherited: yes Percentages: N/A Media: visual Computed value: the initial value or as specified
This property describes how inline content of a block is aligned.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 05-25-2007, 08:21 PM Re: Centering DIVs?
taketherisk's Avatar
Skilled Talker

Posts: 88
Name: Brett
Location: New Zealand
Quote:
I beg your pardon, I make my living building web sites and I use CSS exclusively, so I DO know what I'm talking about. For people learning, they need to learn the correct way and they need to learn WHY things are done the way they are. I posted the correct code needed.
I never said that you don't know what you are talking about. The 'correct code needed' was not needed, because my code worked fine.

Quote:
W3C Spec says:
I used 'testing'. But did not realize text-align: left; was already there, as i did not add that in. Which i am very sure i posted above.

The person has got the code they want. This thread was finished about 5 posts ago.
__________________
My Sites:
Free Domain Names
Free Web Hosting
taketherisk is offline
Reply With Quote
View Public Profile
 
Old 05-26-2007, 03:39 PM Re: Centering DIVs?
gsmile's Avatar
Skilled Talker

Posts: 99
Name: graceL
Thanks guys. I'm sorry you guys got into an argument. :P
gsmile is offline
Reply With Quote
View Public Profile Visit gsmile's homepage!
 
Reply     « Reply to Centering DIVs?

Thread Tools

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

vB 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.15505 seconds with 11 queries