0

The image is positioned right but the input field appears to have a margin top of 20 px or so but it's never set to have that anywhere in my CSS.

HTML:

<div id="vault_chat_header">
   <span><img src="<%tdir%>img/default_avatar.png" alt="Default Avatar"  class="user_avatar" /></span>
   <span><input type="text" class="vault_chat_text_field" /></span>
</div>

CSS:

.vault_chat_text_field {
    background-color: red;
    height: 48px;
    width: 92%;
}

.user_avatar {
    background-color: red;
    height: 48px;
    width: 48px;
}

DOCTYPE:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

4

1 回答 1

3

只需输入

vertical-align: top;

http://jsfiddle.net/CLGNH/

于 2013-10-20T13:54:11.523 回答