Topic: Css alignment problem Pages that link to <a href="https://ozoneasylum.com/backlink?for=21686" title="Pages that link to Topic: Css alignment problem" rel="nofollow" >Topic: Css alignment problem\

 
Author Thread
crip
Nervous Wreck (II) Inmate

From: iasi, romania
Insane since: Apr 2002

IP logged posted posted 05-05-2004 13:53 Edit Quote

I'm trying to vertical align an image inside a div with an explicit height.
From what i read vertical-align doesn't work like the html version valign and that is why i wasn't able to do it using it.
I must admit that i didn't understood why vertical-align doesn't work like valign, but more than that, how can i vertically align that image in the middle of the div?
Thanks.

MajorFracas
Nervous Wreck (II) Inmate

From:
Insane since: Jul 2003

IP logged posted posted 05-05-2004 15:54 Edit Quote

vertical-align is for inline elements (like span, etc.) to specify how they are placed relative to other inline elements in the same line. This is primarily intended for creating superscripts and subscripts although it can also be used to determine how elements such as img are placed relative to the surrounding text.

This attribute is not intended for alignment relative to block elements (such as div). Vertical alignment between block level elements is missing from CSS2 (although, did I read it is being addressed in CSS3? I can't remember. No matter, it will probably be years before the predominant browser supports CSS3 anyway...).

There are some workarounds using margins and/or padding that may work for you. A quick search on google will point you in the right direction.

(Edited by MajorFracas on 05-05-2004 16:00)



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu