Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the semantically correct way to break headings into lines?

Tags:

html

I think (don't know why) that using <br/> is kind of bad...

<h1>My<br/>
multiline header - notice only first<br/>
line contains short word</h1>

Are there other suggestions?

Update One of the lines will be shorter than the others

like image 935
David Avatar asked Apr 18 '11 10:04

David


People also ask

How do you break a heading line?

The <br> tag is for line breaks. The <h1> to <h6> tags are used for different size headings.

How do I make a heading paragraph and line break in HTML?

Paragraph elements are marked using the <p> tag. Whenever the browser encounters a <p> tag, it starts the contents marked by it on a new line. Note that if you start a sentence on a new line within the <p> tag, or if you indent sentences using spaces, the browser will simply ignore all of that white space.

How do you write headings on the same line?

Type the "Heading 1" text on one line, and press Enter. Type the "Normal" text on the next line. Click on the ¶ button (on the Standard toolbar at the top of your screen) to show non-printing characters. Select the ¶ mark at the end of the heading 1 line, and click on Format | Font | check the "Hidden" box.

How do you break a line in HTML?

To do a line break in HTML, use the <br> tag. Simply place the tag wherever you want to force a line break. Since an HTML line break is an empty element, there's no closing tag.


1 Answers

There is nothing wrong with <br />.

If you want to insert a line break on a unusual place, and you actually mean a line break, then use a line break.

like image 192
orlp Avatar answered Oct 15 '22 00:10

orlp