1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Document</title>
- <style>
- .box1{
- border:3px solid black;
- }
- .box1 img{
- width: 50px;
- vertical-align: bottom;
- }
- .box1 span{
- font-size: 30px;
- }
- .box2{
- border:3px solid black;
- margin-top: 20px;
- font-size: 0;
- }
- .box2 div{
- width: 400px;
- height: 300px;
- background-color: blue;
- display: inline-block;
- }
- .box2 .div1{
- font-size: 20px;
- vertical-align: top;
- }
- .box2 .div2{
- font-size: 20px;
- }
- </style>
- </head>
- <body>
- <!-- vertical-align 调整行元素、行块元素的垂直对齐方式 top middle bottom baseline -->
- <div class="box1">
- <img src="./image/arr.png" alt="arr">
- <span>Margin</span>
- </div>
- <div class="box2">
- <div class="div1">
- <p>1</p>
- <p>2</p>
- <p>3</p>
- </div>
- <div class="div2">
- <p>1</p>
- <p>2</p>
- </div>
- </div>
- </body>
- </html>
|