Previous Message
Next Message

Vertical alignment of text within div

Sent by Daniel Klein on 21 June 2004 19:07


I am sure this has been asked a hundred times, however I didn't manage 
to find help on this subject - the search function on this mailing 
list's archives seems broken, searching for 'text "vertical align"' 
returned me all mails from the list, even such containing only one of 
these words. That's hardly useful to me :/

I want to do something incredibly simple: Align the text inside a div 
vertically centered. Here's the stuff I've tried:

I gave the div a height first, obviously. Then I went ahead and stuck my 
text inside a p (which should render as a block element, right? Just in 
case, I stuck a display: block on the p as well). Told it to set 
padding-top and padding-bottom: auto. Did the same for margin. Tried 
vertical-align: middle on both the p and the div. Nothing at all.

A quick and simple answer would be appreciated; even better would be a 
link to a *SIMPLE* tutorial; those tutorials that my google searches 
produce seem to either concentrate on incredibly complex completely 
useless (for me at any rate) things like cross browser issues or go to 
the other extreme and describe nothing else than a 3 column layout.

Oh, if anyone is interested: I'm trying to make a mockup panelling for a 
comic I'm working on, to give my drawer an idea of how I want the panels 
to look. I decided this would be a good opportunity to finally learn css 
based layoutting.. and had to find out it was a damn lot harder than I 
expected. I invite you to look at
http://www.ubermutant.de/eyes/panelling.html
I put the CSS inline to keep the buffer changing in emacs down to .. ehm 
... nothing :P

Any and all help much appreciated!

Daniel
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread:

Possibly related: