html - Why does "overflow: hidden" cause the text to change size and shape? -
under following html , css:
here fiddle of below:
/*css*/ .header { margin: 0px; padding: 0px; width: 100%; } .headertable { padding: 0px; margin: 0px; width: 100%; border-spacing: 0px; } .headertabletr { width: 100%; padding: 0px; margin: 0px; } .logoanimation { text-decoration: none; color: black; } .logoanimation p { display: inline-block; margin: 0px; } .logodisapear1 { overflow: hidden; width: 0px; -webkit-transition: 0.2s linear; -moz-transition: 0.2s linear; -o-transition: 0.2s linear; transition: 0.2s linear; } .logoanimation:hover .logodisapear1 { width: 23px; } .logoanimation:hover .logodisapear2 { width: 56px; } .logodisapear2 { overflow: hidden; width: 0px; -webkit-transition: 0.4s linear; -moz-transition: 0.4s linear; -o-transition: 0.4s linear; transition: 0.4s linear; -webkit-transition-delay: 200ms; -moz-transition-delay: 200ms; -o-transition-delay: 200ms; transition-delay: 200ms; }
<div class="container"> <div class="header"> <table class="headertable"> <tr class="headertabletr"> <td class="headerlogo"> <div class="logoanimation"> <a href=""> <p> <</p> <p>c</p> <p class="logodisapear1">ode</p> <p>u</p> <p class="logodisapear2">niversity</p> <p>/></p> </a> </div> </td> </tr> </table> </div> </div>
why 'ode' , 'niversity' move , go smaller?
when delete
overflow: hidden;
it goes normal size, text overlaps?
the scroll bar takes height in <p>
element.
add vertical-align: bottom
:
/*css*/ .header { margin: 0px; padding: 0px; width: 100%; } .headertable { padding: 0px; margin: 0px; width: 100%; border-spacing: 0px; } .headertabletr { width: 100%; padding: 0px; margin: 0px; } .logoanimation { text-decoration: none; color: black; } .logoanimation p { display: inline-block; margin: 0px; } .logodisapear1 { overflow: hidden; vertical-align: bottom; width: 0px; -webkit-transition: 0.2s linear; -moz-transition: 0.2s linear; -o-transition: 0.2s linear; transition: 0.2s linear; } .logoanimation:hover .logodisapear1 { width: 23px; } .logoanimation:hover .logodisapear2 { width: 56px; } .logodisapear2 { overflow: hidden; vertical-align: bottom; width: 0px; -webkit-transition: 0.4s linear; -moz-transition: 0.4s linear; -o-transition: 0.4s linear; transition: 0.4s linear; -webkit-transition-delay: 200ms; -moz-transition-delay: 200ms; -o-transition-delay: 200ms; transition-delay: 200ms; }
<div class="container"> <div class="header"> <table class="headertable"> <tr class="headertabletr"> <td class="headerlogo"> <div class="logoanimation"> <a href=""> <p> <</p> <p>c</p> <p class="logodisapear1">ode</p> <p>u</p> <p class="logodisapear2">niversity</p> <p>/></p> </a> </div> </td> </tr> </table> </div> </div>
Comments
Post a Comment