HOME C C++ PYTHON JAVA HTML CSS JAVASCRIPT BOOTSTRAP JQUERY REACT PHP SQL AJAX JSON DATA SCIENCE AI

Learn into HTML paragraphs

In HTML, a paragraph is defined using the <p> tag. The </p> is commonly used to structure and organize textual content on a web page. Here's a simple example:tag is a block-level element that represents a paragraph of text.

Example

    
<p> This is the first paragraph. </p>

<p> This is the second paragraph. </p>

You can click on above box to edit the code and run again.

Output

This is the first paragraph.

This is the second paragraph.

HTML Display

An HTML display, in the context of web development, doesn't directly refer to a specific element or code within HTML. It's more of a broad term encompassing various ways to showcase information or content using HTML and potentially other web technologies like CSS and JavaScript.

Example

    
<p>This is a paragraph of text. It can contain multiple sentences and provides a way to structure content on a web page.</p>
       
<p>This is a paragraph of text. It can contain multiple sentences and provides a way to structure content on a web page.</p>
       
You can click on above box to edit the code and run again.

Output

This is a paragraph of text. It can contain multiple sentences and provides a way to structure content on a web page.

This is a paragraph of text. It can contain multiple sentences and provides a way to structure content on a web page.

Horizontal Rules Of HTML : Not Just for Dividing Text Anymore

In HTML, the <hr> tag is used to create a horizontal rule, also known as a horizontal line or a divider. The <hr> tag is a self-closing tag, meaning it doesn't have a closing tag. It is commonly used to separate content within a page, providing a visual break or division.

Example
<p>This is some content above the horizontal rule.</p>
<hr>
<p>This is some content below the horizontal rule.</p>
     
You can click on above box to edit the code and run again.

Output

This is some content above the horizontal rule.

This is some content below the horizontal rule

How to Use Line Breaks in Your HTML Code

In HTML, line breaks are typically represented using the <br> tag. The <br> tag is a self-closing tag, meaning it doesn't have a closing tag. It is used to create a line break within the text, forcing the content that follows it to appear on the next line.

Example
<p>This is some text with a line break.<br>Here is the text on a new line.</p> 
   
You can click on above box to edit the code and run again.

Output

This is some text with a line break.
Here is the text on a new line.

Beast Formatting Poems with HTML

This poem will display on a single line:

Example
<p>

In a meadow green and wide, Where flowers bloom on every side, Butterflies dance in the sunny air, A world of wonders beyond compare.

Buzzing bees and ladybugs small, Climbing trees, we have a ball. Birds up high in the blue sky, Their cheerful songs, oh, how they fly.

Sunshine kisses the grassy ground, Nature's symphony, all around. Raindrops fall, a gentle sound, Turning the world a lush green mound.

So let's explore, you and me, In this land of endless glee. Class 2 friends, hand in hand, Discovering magic in this wonderland.

</p>
You can click on above box to edit the code and run again.

Output

In a meadow green and wide, Where flowers bloom on every side, Butterflies dance in the sunny air, A world of wonders beyond compare.

Solution - The HTML <pre> Element

The HTML <pre> element (short for "preformatted text") defines preformatted text. Text within this element is typically displayed in a fixed-width font (usually Courier), and it preserves both spaces and line breaks. The <pre> tag is often used when you want to display code snippets, ASCII art, or any content where the formatting is important.

Example
<p>

Buzzing bees and ladybugs small, Climbing trees, we have a ball. Birds up high in the blue sky, Their cheerful songs, oh, how they fly.

</p>
You can click on above box to edit the code and run again.

Output

So let's explore, you and me, In this land of endless glee. Class 2 friends, hand in hand, Discovering magic in this wonderland.