The element on the left of the css is as high as the element on the right. How to center vertically?

The left element of the

css is as high as the right element. How to center vertically?
effect

clipboard.png


clipboard.png



span:nth-child(1){}


clipboard.png

but how to center vertically?

Dec.21,2021

this can be classified as a multi-column contour problem. In fact, you want to achieve two columns of equal height, it is not necessarily the same height, but the space height of the left and right columns of color seems to be the same.
the solution you have given above can be regarded as one, and there are some other ingenious solutions. You can poke this DEMO to see:

https://github.com/chokcoco/C.

.

isn't it easy to do it with table?


you use display:flex to make a contour layout, or it is difficult to set it in the middle.

// 
  display: flex;
  align-items: center;

disadvantage: css3 needs to be supported.


this is a very standard form

can be achieved directly with table , and the compatibility is good

.

can be laid out with flex, compatible with low-end computers with autoprefixer, this is the online address


add
display:table-cell;
vertical-align: middle;

where you need it.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea7499-1e3b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea7499-1e3b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?