Explain the paragraph tag
and
its attribute?
Answers
Explanation:
The paragraph tags are used to define a block of text as a paragraph. This HTML element is one of the basic HTML tags you should learn to use properly. When a block of text is surrounded by the paragraph tags, the browser automatically adds white space before and after the paragraph.
Paragraph Tag
The paragraph tags are used to define a block of text as a paragraph. This HTML element is one of the basic HTML tags you should learn to use properly.
<p>
Paragraph Tag Attributes
The paragraph tag has a few basic attributes you should learn about to start with.
id - this has to be unique to the page. An id can be used on multiple pages but only once on a single page.
An id can be used in the stylesheet to set specific formatting to the paragraphs with this id.
class - A class is used to apply styling to the paragraph. It can be applied to many paragraphs on the page or across the whole website.
lang - defines the language used in the paragraph. You would use this if the contents of the paragraph is different from the base language of the web page. e.g. French when the rest of the page is in English.
style - The style attribute is used when you want to apply specific styling to a paragraph.
Novice web page coders and some HTML editors do this when using the design view of the HTML editor like a word processing program.
</p>