PDA

Click to See Complete Forum and Search --> : Center text with CSS


Wynd
Feb 21st, 2001, 06:22 PM
How do I do this? Right now I am doing {text-align: center;}, and it doesn't work. I also tried {align: center;}, but that won't work either. Can anyone help?

equuelus
Feb 21st, 2001, 06:47 PM
it's not much of a problem if you use Dreamweaver.
try this...tell me if it works..

.center {text-align: center}

good luck

Wynd
Feb 22nd, 2001, 05:34 PM
I finally got it, it turns out I have to use divs instead of spans.

equuelus
Feb 22nd, 2001, 07:55 PM
do you know what the difference is, between span and div??

Psyrus
Feb 25th, 2001, 03:23 PM
<span> is usually used inline and does not have an HTML alignment attribute where the <div> tag does. In HTML you could have <div ALIGN = "center">. This cannot be done with the <span> tag and since no attribute exists in HTML for it you cannot set it in a style.