css - HTML input field border smaller than div that contains it -
i struggeling problem. input field border (when typing) smaller div field (the border big placeholder), can see on picture below.
the css code input field following:
.form_login_username { position: relative; width: 100%; background-color: white; border-radius: 5px; border: 1.2px solid #4d4d4d; padding: 12px 20px; margin-bottom: 15px; } .form_login_username img { position: absolute; top: 1px; left: 5px; } .form_login_username input { border: none; width: 100%; padding-left: 45; box-sizing: border-box; }
the html code input field one:
<div class = "form_login_username"> <img src = "user_icon.png" width = "40" /> <input type = "text" name = "username" placeholder = "enter username" required /> </div>
and set color field (when typing) in style part of html element:
input:focus { border: none; outline: 1.2px solid #feb434; }
please me, don't know why border small. thank you!
edit: solved problem. else struggels problem, put "padding" input css style, instead of div css style. problem was, white field wasn't input field, div field, put padding value input css style , border appear around white field :)
add height property , set required 30px
.form_login_username input { border: none; width: 100%; padding-left: 45; box-sizing: border-box; height: 30px; }
Comments
Post a Comment