Trying to center align

K

Kris

DIV.container
{
text-align: center;
}
should do the trick.

It's been deprecated. Please keep up with the changes.[/QUOTE]

Are you intentionally or unintentionally spreading misinformation? In
any case, I friendly ask you to stop doing that.
 
T

Toby Inkster

Henry said:
You have float right and left but not center.
To center something you have to scratch your head a lot and use some tricks.

#blah {
width: 50%;
margin: auto;
}

That's "a lot of tricks"?
 
H

Henry

Toby said:
Henry wrote:




#blah {
width: 50%;
margin: auto;
}

That's "a lot of tricks"?


Yep and is not intuitive at all.

Nothing here is suggesting that #blah will be centered.

If you type...

#blah {align:center;}

That is easy, intuitive and simple.

KISS! Always the best.

Merry Xmas Toby. You are great in css but it doesn't mean they are
simple. That means that you are good.

;)
 
N

Nick Theodorakis

[...]
If you type...

#blah {align:center;}

That is easy, intuitive and simple.

No it's at best ambiguous. Does it mean:

(1) horizontally center the inline content? (i.e., the equivalent of
text-align: center)

or

(2) center a block between its margins (with the inline content within
centered or not)?

Nick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top