Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What does vertical-align mean in css

2025-03-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you what the meaning of vertical-align in css, I believe that most people do not know much, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to understand it!

The vertical-align attribute defines the vertical alignment of the baseline of an inline element relative to the baseline of the row in which the element is located. Allows you to specify negative length values and percentage values. This causes the element to fall rather than rise. In a table cell, this property sets the alignment of the contents of the cell in the cell box.

The vertical-align attribute has more values:

Baseline: default. The element is placed on the baseline of the parent element.

Sub: the subscript for vertically aligned text.

Super: superscript of vertically aligned text

Top: aligns the top of the element with the top of the highest element in the row

Text-top: aligns the top of the element with the top of the parent element font

Middle: place this element in the middle of the parent element.

Bottom: aligns the top of the element with the top of the lowest element in the row.

Text-bottom: aligns the bottom of the element with the bottom of the font of the parent element.

Length:

%: use the percentage value of the "line-height" attribute to arrange this element. Negative values are allowed.

Inherit: specifies that the value of the vertical-align attribute should be inherited from the parent element.

For example, vertical-aligntop is the top of the vertically aligned text.

In the table, this property sets the alignment of the contents of the cell. the most common application of align-align should be in the td, controlling the location of internal objects.

Let's look at a concrete example:

Img.top {vertical-align:text-top}

Img.bottom {vertical-align:text-bottom}

This is an image in a paragraph.

This is an image in a paragraph.

The above is all the content of this article "what is the meaning of vertical-align in css?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report