Negative padding-top, fixed height, overflow hidden
10,033
You might want to use margin-top instead of padding-top. Padding can not be negative.
Author by
bernedef
Updated on June 04, 2022Comments
-
bernedef about 2 years
how can I show only 200px (height) of my div, and skip the first 30px (top) ?
<div style="height:200px; overflow:hidden; padding-top:-30px"> A<br>B<br>C<br>D<br>E<br>F<br>G<br> H<br>I<br>J<br>K<br>L<br>M<br>N<br> O<br>P<br>Q<br>R<br>S<br>T<br>U<br> V<br>W<br>X<br>Y<br>Z </div>