When line-level block elements and text-type elements do not contain text, the outer text is aligned with its bottom
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<span></span>123
</body>
<style>
* {
margin: 0;
padding: 0;
}
span{
display: inline-block;
width: 100px;
height: 100px;
background-color: pink;
}
</style>
</html>
If there is text in the span, it will be aligned with the text in it
Adjust the alignment of a row of elements
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<span>123</span>123
</body>
<style>
* {
margin: 0;
padding: 0;
}
span{
display: inline-block;
width: 100px;
height: 100px;
background-color: pink;
vertical-align:50px;
}
</style>
</html>