Send to a Friend

Know someone who might have the answer? Pass it along!

Vincentt's avatar

How can I shrink a <div> to its content, while still having it centered?

Asked by Vincentt (2170 points) | asked October 29th, 2007 | 8 responses

Hey, there’s this <div> I want to center on an HTML page but I don’t want it to take the full width… I could shrink it by adding float: left; but then it doesn’t center :(

Topics: , , ,
Separate multiple emails with commas.
We’ll only use these addresses to forward this discussion.