In this tutorial, you will HTML Paragraphs
HTML paragraphs are used to create blocks of text on a web page. They are defined using the <p>
tag, with the text of the paragraph being placed between the opening and closing tags. Here’s an example of how to create a paragraph in HTML:
<p>This is a sample paragraph. It can contain any kind of text, including links, images, and other HTML elements.</p>
You can also specify the text alignment within a paragraph using the align
attribute. The values that can be used for aligning text are left, right, center and justify.
<p align="center">This text will be center aligned.</p>
In addition to the p
tag, you can also create line breaks within a paragraph by using the br
tag. The br
tag does not have a closing tag, and it creates a line break wherever it is placed.
<p>This is a sample paragraph with <br> a line break.</p>
You can also add a class or id attribute in the p
tag and target it in CSS for styling like font-size, color, font-family and etc.
<p class="paragraph">This is a sample paragraph with class attribute.</p>
You could style the class using CSS like this
.paragraph { font-size: 18px; color: blue; }
That’s the basic way to create paragraphs in HTML, and you can add a lot more style and functionality by using CSS,JavaScript or other technologies.