Home > Web Front-end > HTML Tutorial > vertical-align implements input and img alignment

vertical-align implements input and img alignment

高洛峰
Release: 2017-02-25 14:21:39
Original
1564 people have browsed it

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;}
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template