html - Fit h1 div Height to Font Size -


i edited font size of h1 tag, looks height of div doesn't automatically fit it:

enter image description here

i tried manually setting height, div extends below instead of encasing text:

enter image description here

is there way make div fit font size?

here's css:

h1 {     background-color: red;/* test */      font-family: lobster;     font-size: 66px;     font-style: normal;     font-variant: normal;     font-weight: 500;     line-height: 26px; } 

change:

h1{     background-color: red;/* test */      font-family: lobster;     font-size: 66px;     font-style: normal;     font-variant: normal;     font-weight: 500;     line-height: 1;/*change here, don't put px @ end*/ } 

see if works you.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -