We are independent & ad-supported. We may earn a commission for purchases made through our links.
Advertiser Disclosure
Our website is an independent, advertising-supported platform. We provide our content free of charge to our readers, and to keep it that way, we rely on revenue generated through advertisements and affiliate partnerships. This means that when you click on certain links on our site and make a purchase, we may earn a commission. Learn more.
How We Make Money
We sustain our operations through affiliate commissions and advertising. If you click on an affiliate link and make a purchase, we may receive a commission from the merchant at no additional cost to you. We also display advertisements on our website, which help generate revenue to support our work and keep our content free for readers. Our editorial team operates independently of our advertising and affiliate partnerships to ensure that our content remains unbiased and focused on providing you with the best information and recommendations based on thorough research and honest evaluations. To remain transparent, we’ve provided a list of our current affiliate partners here.
Software

Our Promise to you

Founded in 2002, our company has been a trusted resource for readers seeking informative and engaging content. Our dedication to quality remains unwavering—and will never change. We follow a strict editorial policy, ensuring that our content is authored by highly qualified professionals and edited by subject matter experts. This guarantees that everything we publish is objective, accurate, and trustworthy.

Over the years, we've refined our approach to cover a wide range of topics, providing readers with reliable and practical advice to enhance their knowledge and skills. That's why millions of readers turn to us each year. Join us in celebrating the joy of learning, guided by standards you can trust.

What Is an HTML Paragraph?

By Eugene P.
Updated: May 17, 2024
Views: 9,651
References
Share

A HyperText Markup Language (HTML) paragraph is a tag used inside an HTML document to define a block as a paragraph. It is a block-level element and is prohibited by the HTML language specification from containing most other block-level elements. Encasing a block of text within an HTML paragraph tag has the effect, in most web browsers, of inserting a blank line before the paragraph begins and after the end of the block. Defining an area as a paragraph also has the benefit of allowing the entire contents to have specific styles applied to it through the use of cascading style sheets (CSS). It is generally considered bad form to use multiple paragraph blocks as the only formatting on a page, although there are some situations in which this might be necessary.

The HTML paragraph tag is one of the most basic elements that can be contained in an HTML document. It also is a block-level element, meaning it defines a block of code or text. This restricts the type of code that an HTML paragraph can actually contain, excluding most other block-level elements such as structured lists and other paragraphs. Only inline formatting tags can be used inside of a paragraph block, including tags for italics, bold or address links.

The reason an HTML paragraph tag is necessary is that, when an HTML document is read by a web browser, it removes most of the spaces and line breaks that were used. There are a number of reasons for this, but one is because of the different ways computer operating systems actually define a line break, making it easier to remove them than to translate them. Without the ability to use line breaks, HTML tags must be utilized to define formatting. Often used in conjunction with the HTML paragraph tag is another tag known as a line break, which simply inserts a blank line wherever the tag is located. Using multiple line breaks inside a larger paragraph block is the preferred way of providing spacing, as opposed to many paragraph tabs that, when placed concurrently together, will actually cause multiple line breaks between paragraphs.

There are several attributes an HTML paragraph tag can use, although some of them have been replaced by CSS attributes that provide more accurate layout and spacing options. Alignment of the paragraph — to the right, left or center — is one of these depreciated attributes. Some other elements of a paragraph that can be changed are the direction of the text for foreign languages and the reaction to normal user actions such as passing the mouse over the block or clicking on it.

Share
WiseGeek is dedicated to providing accurate and trustworthy information. We carefully select reputable sources and employ a rigorous fact-checking process to maintain the highest standards. To learn more about our commitment to accuracy, read our editorial process.
Link to Sources

Editors' Picks

Discussion Comments
By Vincenzo — On Jul 20, 2014

@Logicfest -- I don't know. I would think that all browsers, at this point, would interpret CSS the same way. Standards are a big deal, after all, and those browsers that refused to follow them aren't around anymore.

You can get some more flexibility with formatting through CSS, so why not use it? All modern browsers should interpret things the same way.

By Logicfest — On Jul 19, 2014

One of the great things about the good old paragraph tag is that it is a standard thing that will be interpreted by virtually all browsers in exactly the same way. In other words, it is a reliable way to achieve formatting regardless of what browser is interpreting the page.

There are some arguable better options in CSS, but will they all be interpreted the same way? Maybe and maybe not. There are times it is best to go with what you know will work.

Share
https://www.wisegeek.net/what-is-an-html-paragraph.htm
Copy this link
WiseGeek, in your inbox

Our latest articles, guides, and more, delivered daily.

WiseGeek, in your inbox

Our latest articles, guides, and more, delivered daily.