What is the default height of elements?

I'm working with a web page that currently uses tags <br>

for markup and page layout, and I want to remove all of those tags and replace them with their CSS equivalent to make the page more readable from the screen.

As part of this process, I need to replace the break tags that are currently used for CSS-based padding interpolation.

Can anyone tell me what the default line break height is so that I can set my padding to equal that height and save a lot of time?

+3


source to share


1 answer


Element

A <br>

represents a line break. The line break height is determined by the current line height of the part of the document that contains the break item.



The default line height depends on a number of factors, including the browser you are using and the current font family. You can find the exact computed line-height for any given element in Chrome by checking the element, switching to the computed style tab and filtering for the property line-height

. In most browsers, you should be able to approximate this height with a length of about 1.2em

. For more information on units, em

see the section on relative length units from MDN.

+10


source







All Articles