Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the default height of <br> elements?

Tags:

css

padding

I'm working with a web page which currently uses <br> tags for spacing and page layout, and I want to remove all these tags and replace them with an equivalent in CSS to make the page more accessible to screen readers.

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

Could someone 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?

like image 268
Smithy Avatar asked May 29 '15 16:05

Smithy


People also ask

How do you adjust the BR tag height?

You can't change the height of <br> tag as its not an HTML element, it is just an instruction which enforces a line break. br does not take up any space in the page. There is a way by which you can increase line break between lines, is by putting multiple br tags.

What is the default height of a div in HTML?

According to the spec, a default value of 8px is expected to be used for the margin.

What is Br in CSS?

The <br> tag in HTML document is used to create a line break in a text. It is generally used in poem or address where the division of line is necessary.

What is the BR tag?

Definition and Usage The <br> tag inserts a single line break. The <br> tag is useful for writing addresses or poems. The <br> tag is an empty tag which means that it has no end tag.


1 Answers

A <br> element represents a line break. The height of a line break is determined by the current line height of the portion of the document the break element is in.

The default line height depends on a number of factors, including the browser you're using and the current font family. You can find the exact computed line height for any given element in Chrome by inspecting the element, switching to the computed style tab, and filtering for the line-height property. In most browsers, you should be able to approximate this height with a length value of around 1.2em. For more on em units, see the section on relative length units from MDN.

like image 200
Ajedi32 Avatar answered Sep 17 '22 23:09

Ajedi32