Home > Article > Web Front-end > vertical-align implements input and img alignment
Put input and img on the same line. The img tag is always higher than the input, which is very ugly. I have tried many methods before, but none of them work. Later, the most searched thing on the website was to add an align="absmiddle" attribute to img. This method seems feasible, but it does not comply with HTML standards. Later, I accidentally discovered that it is enough to add vertical-align:middle to input and img at the same time:
input,img{vertical-align:middle;}
In this way, the code will be aligned horizontally.
For more articles related to using vertical-align to align input and img, please pay attention to the PHP Chinese website!