el-icon is not vertically centered and not aligned with the text

When we use el-cion, after rendering, it is an i wrapped with an svg. By default, it will not be vertically centered, and it will form an offset with the text.

 

Centering strategy:

1. Set the outer div to display:flex, and set it to be vertically centered

2. Set the el-icon to a size, which is about the same size as the text

The final effect: successfully centered vertically and aligned with the text

Guess you like

Origin blog.csdn.net/m0_58768224/article/details/129722187