Prepared by: Anthony Larrain
More on Headings
- Headings organize the information on your page into meaningful sections.
- Each page of your website should have a main heading, in print referred to as the title.
- HTML provides 6 levels of headings,
h1 - h6
.
Example 1
Heading one
Heading two
Heading three
Heading four
Heading five
Heading six
Browser Display
Heading one
Heading two
Heading three
Heading four
Heading five
Heading six
Notice that each heading has a default style. The style of an element can refer to the font, font size, color, alignment and margins. Each of the heading tags place a blank line before and after the element. They start out big and bold and decrease in size.
The following is an example of a webpage with multiple headings and styles. The headings are circled in red.
Paragraphs
To create paragraphs in HTML use the <p>
tag.
Example
Paragraph one
Paragraph two
Paragraph three
Browser Display
Paragraph one
Paragraph two
Paragraph three
Notice the default style places a line break before and after each paragraph. Each paragraph is left justified.
Line Breaks
To create a line break in HTML use the <br>
tag.
A line break starts a new line but not a new paragraph.
Example
One for the money
Two for the show
Three to get ready
go cat go
Browser Display
One for the money
Two for the show
Three to get ready
Go cat go
Notice the line break tag doesn't apply to any text it is simply a command to the browser to jump to the next line.
Empty Elements
- Empty elements are elements that do not contain any text, like the line break tag (<br>).
- Elements with text are nonempty.
- Recall all tags should have a corresponding ending tag.
- To close the line break tag write <br />. Notice the space between the / and the br