Using Br To Insert Line Breaks In HTML: Here's How »
Có thể bạn quan tâm
Contents
- 1 Code Example
- 2 Don’t abuse line breaks
- 3 Browser Support for br
- 4 Attributes of br
Code Example
This sentence and the next will be on different lines.<br>This sentence and the one before will be on different lines.This sentence and the next will be on different lines.This sentence and the one before will be on different lines.Don’t abuse line breaks
The <br> element creates a line break. It can be easy to abuse this element to create styling which that mimics better, more semantic options like paragraphs ( <p> ) and lists. Generally, the <br> element should only be used if the line break itself is an intrinsic part of the content. This might be the case, for example, with:
- addresses
- poetry
- code samples
Out of the night that covers me,Black as the pit from pole to pole,I thank whatever gods may beFor my unconquerable soul. In the fell clutch of circumstanceI have not winced nor cried aloud.Under the bludgeonings of chanceMy head is bloody, but unbowed. Beyond this place of wrath and tearsLooms but the Horror of the shade,And yet the menace of the yearsFinds, and shall find me, unafraid. It matters not how strait the gate,How charged with punishments the scroll,I am the master of my fate:I am the captain of my soul.
— Invictus, by William Ernest Henley
If you find yourself using <br> to separate blocks of texts, you may need to think about using paragraph tags or another element. If you are using them to create more space between items, you should use CSS margin.
Adam WoodAdam is a technical writer who specializes in developer documentation and tutorials.Browser Support for br
All | All | All | All | All | All |
Attributes of br
Attribute name | Values | Notes |
---|---|---|
clear | Was used to ensure that line breaks "cleared" floated or aligned elements above them. Deprecated. |
Từ khóa » Html Br Options
-
The
HTML Element Produces A Line Break In Text (carriage-return). It Is Useful For Writing A Poem Or An Address, Where The Division Of Lines Is Significant. ... Technical Summary. -
HTML Br Tag - W3Schools
-
Add A Line Break In HTML - Tutorial - TeachUcomp, Inc.
-
HTML
Tag -
Line Break In HTML Select Option? - Stack Overflow
-
HTML
Tag - W3docs -
Br | Dash For Python Documentation | Plotly
-
HTML
Tag - GeeksforGeeks -
Main Tips On HTML Line Break - BitDegree
-
HTML Line Break – How To Break A Line With The HTML
Tag -
What Is The Best Alternative To Repetitive Typing Of
Tags In HTML ... -
Alignment, Font Styles, And Horizontal Rules In HTML Documents
-
HTML Standard
-
Br Tag In HTML - Scaler Topics