6

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?

Ajedi32
  • 45,670
  • 22
  • 127
  • 172
Smithy
  • 771
  • 10
  • 29
  • 1
    It should be the same as the default line-height of your document...i think. – Novocaine May 29 '15 at 16:17
  • 5
    The question doesn't make much sense.
    is a line break. It doesn't have a height, it just breaks the line.
    – JJJ May 29 '15 at 16:18
  • http://stackoverflow.com/questions/1409649/how-to-change-the-height-of-a-br – Dmitriy May 29 '15 at 16:19
  • 1
    Doesn't replacing mean, removing the element? As in getting rid of the break tag? I also don't follow your question. – digwig May 29 '15 at 16:24
  • 1
    To clarify, you mean to say you're working with a web page which incorrectly uses `
    ` tags for formatting, and you need to replace those tags with an equivalent in CSS, right? I'm going to edit to clear things up a bit, feel free to revert if my edit changes the intent of your question.
    – Ajedi32 May 29 '15 at 16:39
  • I think it is `1.2` or `120%`. That's all I know. – Zachary Rude Jun 05 '21 at 17:41

1 Answers1

13

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.

Ajedi32
  • 45,670
  • 22
  • 127
  • 172