HTML Tutorial
A paragraph is often a chunk of text that always begins on a new line.
The paragraph is defined by the HTML <p> element.
Every paragraph begins on a new line, and browsers prefix and end paragraphs with white space, or margins, by default.
This is a title.
This is another title.
It is impossible to predict how HTML will appear.
Resized windows and large or small screens will produce various outcomes.
You cannot alter the presentation of HTML by including extra lines or spaces in your code.
When the page is displayed, the browser will automatically eliminate any additional lines and spaces:
This title
contains a lot of words
in the source code,
but the browser
ignores it.
This title
contains a lot of gaps
in the source code,
but the browser
ignores it.
A theme break in an HTML page is defined by the <hr> tag, which is typically shown as a horizontal rule.
In an HTML page, the <hr> element is used to define a change or to split content:
This is title 1
This is some content.
This is itle 2
This is some other content.
The <hr> tag is an empty tag, which means that it has no end tag.
A line break is defined by the HTML <br> element.
If you want to insert a new line without beginning a new paragraph, use <br>:
This is
a sentence
with line breaks.
The <br> tag is an empty tag, which means that it has no end tag.
There will be just one line displaying this poem:
My Doll lies over the ocean.
My Doll lies over the sea.
My Doll lies over the ocean.
Oh, bring back my Doll to me.
Element
Preformatted text is defined by the HTML <pre> element.
When text is displayed inside a <pre> element, line breaks and spaces are preserved and it is displayed in a fixed-width font, often Courier:
My Doll lies over the ocean.
My Doll lies over the sea.
My Doll lies over the ocean.
Oh, bring back my Doll to me.
CodingAsk’ tag reference contains additional information about HTML elements and their attributes.
Paragraphs are the basic building blocks of written content on web pages. They help organize your text and make it easier for readers to consume.
To create a new paragraph, simply enclose your text within the opening <p> and closing </p>.
Understanding these basic HTML paragraphs and text formatting elements is crucial for creating well-structured and visually appealing web content. As you progress through your HTML learning journey, you’ll find many opportunities to put these concepts into practice.
CodingAsk.com is designed for learning and practice. Examples may be made simpler to aid understanding. Tutorials, references, and examples are regularly checked for mistakes, but we cannot guarantee complete accuracy. By using CodingAsk.com, you agree to our terms of use, cookie, and privacy policy.
Copyright 2010-2024 by Refsnes Data. All Rights Reserved.