Your problem, as stated by bfavaretto is the fact that you are telling the browser that the text box size should contain the padding
and the border
:
box-sizing: border-box;
This is causing the input
get size 0 (zero):
As it is without size, what is written does not appear in the same, despite being there:
Animation of your input
transiting from 35px
height for 55px
height making use of browser inspector.
Solution
Since you’re making use of the property box-sizing
with the value border-box
, you can remove the padding-top
and the padding-bottom
of input
that you will get the same result with the text advantage being visible.
Like the height of your input
is higher than indicated on the property height
of the same, I also changed in the example the height of 35px
for 38px
:
input.old {
width: 100%;
height: 35px;
margin-bottom: 10px;
color: #595959;
padding-top: 17px;
padding-right: 17px;
padding-bottom: 17px;
padding-left: 35px !important;
box-sizing: border-box;
background: none repeat scroll 0% 0% #FFF;
border-radius: 5px;
overflow: auto;
outline: 0px none;
border: 2px solid blue;
font-size: 15px;
transition: border 0.5s ease 0s;
opacity: 1;
}
input.new {
width: 100%;
height: 38px;
margin-bottom: 10px;
color: #595959;
padding-right: 17px;
padding-left: 35px !important;
box-sizing: border-box;
background: none repeat scroll 0% 0% #FFF;
border-radius: 5px;
overflow: auto;
outline: 0px none;
border: 2px solid blue;
font-size: 15px;
transition: border 0.5s ease 0s;
opacity: 1;
}
<input type="text" class="old" value="Bubu está escondido">
<br>
<input type="text" class="new" value="Bubu está aqui!">
Also in the Jsfiddle.
Wow, that complex, did not know these rules, great explanation, Thank you!
– Vinícius Lara
Very well detailed Zuul, the animated image certainly explains very well the +1 problem
– Guilherme Nascimento