Your problem, as stated by the bfavaretto ♦ is the fact that you are telling the browser that the size of the text box should contain padding
and border
:
box-sizing: border-box;
This is causing input
to be of size 0 (zero):
As it is without size, what is written does not appear in it, although it is there:
Animation of your input
moving from 35px
height to 55px
height by using browser inspector
Solution
Since you are using the box-sizing
property with the value border-box
, you can remove the padding-top
and the padding-bottom
from the input
you will get the same result with the advantage of the text being visible
As the height of your input
is greater than that indicated in the height
property of the same, I also changed in the example the height of 35px
to 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!">