G
G
Good Samaritan2018-02-14 11:06:18
css
Good Samaritan, 2018-02-14 11:06:18

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>

and css
#search{
       height:60px;
   }
    #button{
        height: 60px;
        color: white;
        background-color: cornflowerblue;
    }

For some reason, the button moves to the bottom http://joxi.ru/krDjjBZSEj6on2
. How can I fix this?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Sinitsyn, 2018-02-14
@djamali

Hover your mouse over the button, right click, select View Code, see the styles that are applied to it other than yours.

S
Stalker_RED, 2018-02-14
@Stalker_RED

Not moving out https://jsfiddle.net/6ngj3a2r/

M
monochromer, 2018-02-14
@monochromer

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 question

Ask a Question

731 491 924 answers to any question