Floated Divs Obeying/Not Obeying Vertical-Align

后端 未结 5 999
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-09 20:00

Within a table cell that is vertical-align:bottom, I have one or two divs. Each div is floated right.
Supposedly, the divs should not align to the bottom, but they do (whic

5条回答
  •  青春惊慌失措
    2021-02-09 20:37

    http://www.w3.org/TR/CSS2/visudet.html#line-height

    This property affects the vertical positioning inside a line box of the boxes generated by an inline-level element. The following values only have meaning with respect to a parent inline-level element, or to a parent block-level element, if that element generates anonymous inline boxes; they have no effect if no such parent exists.

    There is always confusion about the vertical-align property in CSS, because in most cases it doesn't do what you expect it to do. This is because it isn't the same as valign, which is allowable in many HTML 4 tags.

    For further information, you can check out:

    http://www.ibloomstudios.com/articles/vertical-align_misuse/ http://www.ibloomstudios.com/articles/applied_css_vertical-align/

    The link which David Alpert posted is incredibly useful in this matter.

提交回复
热议问题