我有一个搜索框,我在它前面放置了一个看起来像是 UTF-8 字符的房子,代表 HOME。我试图降低房子字符,使底部与文本框底部处于同一水平。现在性格稍微高了点。
CSS
#home{font-size:200%; font-weight:bold;padding:0px;border:0px;margin:0px;}
HTML
<form name='input' action='index.php?' method='get'>
<span id='home'>⌂ </span>
<input type='text' name='q' size=75 required autofocus>
<input type='submit' value=' SEARCH '>
</form>
最佳答案
对跨度和输入使用 vertical-align: middle;
参见 JSFiddle
关于html - 文本与文本框的水平对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24961319/