Как мне сделать уведомление «неверный пароль» над моими input? Я знаю, что это делается через echo “и тут html”; но оно мне выводит в левом верхнем углу, а мне надо над input
Asked
Active
Viewed 516 times
0
-
Так и выводить надо рядом с инпутом, не? – u_mulder Jun 23 '20 at 10:27
-
То есть там где проверка пароля , это нужно писать там где и хочу вывести. Просто я писал всегда сверху php, а потом html – max Jun 23 '20 at 10:32
1 Answers
1
body {
margin-top: 80px;
}
.input-wrap {
display: inline-block;
position: relative;
}
.input-wrap .error {
display: inline-flex;
justify-content: center;
align-items: center;
min-width: 135px;
padding: 5px;
border-radius: 5px;
background: red;
color: #fff;
position: absolute;
left: 50%;
bottom: calc(100% + 15px);
z-index: 10;
transform: translateX(-50%);
box-sizing: border-box;
}
.input-wrap .error::after {
content: '';
display: block;
width: 0;
height: 0;
border: 10px solid transparent;
border-top-color: red;
position: absolute;
top: 100%;
left: calc(50% - 10px);
}
<div class="input-wrap">
<div class="error">Неверный пароль</div>
<input type="password" value="12345">
</div>
De.Minov
- 24,026