Answer the question
In order to leave comments, you need to log in
Why does the button shift relative to the input field?
I have the following code:
<form action="/ru/search/node/" method="get" id="searchform">
<input type="search" id="search" placeholder="Поиск..." />
<button type="submit" id="button">Искать</button>
</form>
#search{
height:60px;
}
#button{
height: 60px;
color: white;
background-color: cornflowerblue;
}
http://joxi.ru/krDjjBZSEj6on2
Answer the question
In order to leave comments, you need to log in
Hover your mouse over the button, right click, select View Code, see the styles that are applied to it other than yours.
The button slides out because initially for inline elements, the alignment is on the baseline of the text. Therefore, the button and the input field need to be set to vertical alignment, for example,vertical-align: middle;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question