I’m writing a blog interface
Originally, it didn’t matter if I used sprites or not. It’s a small website.
But I’ve never used sprites before, so I wrote about it today
But I didn’t use sprites before. After inserting icons, pictures and text directly You can center it vertically by using the same height as height and line-height
After using sprites, because the background is inserted, the vertical centering is difficult to control
I don’t know if you have any good methods. Can you recommend it
The original poster should center the container vertically
or
background:url(...) center;
like this?
HTML:
iconA
Add
vertical-align:middle;
Try
Solved
vertical-align:middle; It will still be a little misaligned
Use margin-bottom to adjust it to a negative value and it will be OK
Thanks