D
D
Dmitry Lapeto2017-10-12 17:44:13
css
Dmitry Lapeto, 2017-10-12 17:44:13

Why is input type="text" placeholder floating up in mobile Safari?

Comrades, please help! In Safari on Iphone placeholder crawled up. And in other browsers everything is fine, even in Safari on Android (both on Win10 and on the Iphone simulator)
I tried it through the pseudo ::-webkit-input-placeholder, it also does not solve the problem. Can you give me any other ideas, or maybe someone already solved this problem?
HTML:

<input type="text" name="your-name" value="" size="40" class="wpcf7-form-control wpcf7-text wpcf7-validates-as-required" aria-required="true" aria-invalid="false" placeholder="Введите ваше имя">

His CSS:
.wpcf7 input[type="text"], .wpcf7 input[type="email"], .wpcf7 input[type="tel"], .wpcf7 input[type="date"], .wpcf7 input[type="password"] {
    height: 40px;
    color: #363b45;
    border: 1px solid #b1b5ac;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 0px;
    width: 100%;
}

I also tried to center using line-height - the same canoe.
Printscreens:
59df7edd2a8d8085966999.jpeg
Screen from iPhone
59df7ee44733b614759949.png
screen from simulator
59df7eea17b11288681430.png
screen from safari WIN10

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sasha, 2017-10-12
@dima_lapeto

dima_lapeto
font-height is not specified and line
only specify it correctly.
for example, based on your data it will be height - padding - border = line-height
font-size should be less than line-height by at least 2-4px

R
romanu418, 2017-10-12
@romanu418

line-height: normal;

N
Nikita, 2017-10-12
@Rema1ns

try for space padding: 10px; put padding: 0 10px;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question