Spiegato, Home

Technology and Gadgets

What Is an HTML Line Break?

  • Published by Spiegato
  • 2 min read

In the HyperText Markup Language (HTML), a line break is a tag or cascading style sheet (CSS) property that causes the HTML viewer or web browser to immediately drop down to the next available line and draw the next element, starting at the defined margin. There are two generally accepted ways to insert an HTML line break into a document. The first is to use the break (BR) tag, forcing the browser to start the next elements on the next line, aligned to the left border. The other option is to use different CSS properties to define borders, gutters or spacing around block-level elements to create open space, although this method does not affect word wrapping in a document.

One of the design principles of HTML is that the browser is usually allowed to have some control over the layout of web pages. This allows well-designed sites to have a very fluid appearance, regardless of the size of the display. When a paragraph is drawn, the browser is usually charged with finding the proper place to end a line, usually at the right margin of a block. Using an implicit HTML line break interrupts this process.

The BR tag is the simplest way to end a line and move down. Use of the tag is generally accepted for some minor formatting, although its use is frowned on as the sole way of defining paragraphs in a document. The paragraph tag is preferred for separating areas of text, because it creates a block that can manipulated with CSS or other tags, while the HTML line break tag stands alone and does not enclose a block. The break tag can be used within a paragraph block, largely to prevent the browser from using two breaks between paragraphs, which is the default behavior.

Another method used to cause a line break is to increase the size of a box of text with CSS properties. This effectively extends the bottom of a container so blank space is left after it. This can appear the same as using a break or paragraph tag, except the text within the container is not modified, so word wrapping is still largely controlled by the browser.

One area in which an HTML line break might need to be specified is when text is wrapping around an inline image. An easy way to create cleanly formatted paragraphs that sit to the side of an image is to use the CLEAR modifier for the HTML line break tag. This allows specification for whether a line break should continue as normal or jump to the next available line after an image. It also is possible to create CSS styles that will mimic this behavior, although it might not be as fluid under certain circumstances.

Key terms in this article

Related articles

  • What Is a Control Break?

    A control break is a change in category within a database to allow a computer to calculate subtotals. Control breaks can be necessary for certain kinds of…

  • How do I Break into the SaaS Market?

    Breaking into the Software as a Service market, or SaaS market, is just like getting an initial opportunity in any technology market: It takes dedication…

  • What is a Break Key?

    The break key found on many modern keyboards has a history that can be traced back to telegraphs. This early use of a break key was actually a switch that…

  • What Is HTML ASCII?

    The fonts frequently used in hypertext markup language (HTML) documents are largely based on the original character set established under the American…

  • What Are HTML Scripts?

    HyperText Markup Language (HTML) documents can contain pieces of programming code, or links to source code files, that are executed at different points…