Как сделать уведомление «неверный пароль..»
Как мне сделать уведомление «неверный пароль» над моими input? Я знаю, что это делается через echo “и тут html”; но оно мне выводит в левом верхнем углу, а мне надо над input
Ответы (2 шт):
Автор решения: Endivine
→ Ссылка
Просто напиши скрипт вывода о неверном пароле прямо перед тегом <input> (ну или на строке выше)
Автор решения: CbIPoK2513
→ Ссылка
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>