In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to achieve vertical css pictures, the editor thinks it is very practical, so share it for you to do a reference, I hope you can get something after reading this article.
Vertical-align attribute
We use the text-align property to define the horizontal alignment of the image.
Everyone began to have questions, the picture horizontal alignment we achieved, what if you want to align the picture vertically?
In CSS, we can use the vertical-align property to define the vertical alignment of the picture.
Syntax: vertical-align: attribute value
Vertical-align also has some attribute values such as sub, super, and so on, which we don't need to pay attention to, because they are not used at all in actual development. All we need to do is use the above four attribute values.
Example 1:
Vertical-align attribute
Img {width:80px;height:80px;}
# img_1 {vertical-align:top;}
# img_2 {vertical-align:middle;}
# img_3 {vertical-align:bottom;}
# img_4 {vertical-align:baseline;}
Php Chinese website php Chinese website (top)
Php Chinese website php Chinese website (middle)
Php Chinese website php Chinese website (bottom)
Php Chinese website php Chinese website (baseline)
The effect is as follows:
Wechat screenshot _ 20181112155823.png
Take a closer look. There is a difference between "vertical-align:baseline" and "vertical-align:bottom".
Example 2:
Vertical-align attribute
Div
{
Width:100px
Height:80px
Border:1pxsolidgray
}
.div _ img1 {vertical-align:top;}
.div _ img2 {vertical-align:middle;}
.div _ img3 {vertical-align:bottom;}
Img {width:60px;height:60px;}
This is the end of this article on "how to achieve vertical css pictures". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.