You're online now.

Hurray! you are online now.

HTML Paragraphs

In HTML, a paragraph is defined using the <p> tag. The opening tag <p> indicates the start of a paragraph, and the closing tag </p> indicates the end of the paragraph. This tag is used to mark up a block of text as a separate paragraph. Paragraph starts on a new line, and web browsers add some white space pr margin automatically before and after a paragraph.

<!-- HTML paragraph -->
    <!DOCTYPE html>
    <html>
    <head>
    	<title>Example Paragraph</title>
    </head>
    <body>
    	<p>This is an example paragraph. It contains some text that we want to mark up as a separate paragraph.</p>
    </body>
    </html>
    

Horizontal Rules HTML

In HTML, horizontal rules are defined by the ‘<hr>’ tag. This tag is add a horizontal line which is used to visually separate content on a web page. The ‘<hr>’ tag is an empty tag, that means it has no end tag.

<!-- HTMl Horizontal Line Ruels -->
    <!DOCTYPE html>
    <html>
    <head>
    	<title>Example Horizontal Rule</title>
    </head>
    <body>
    	<p>This is some text above the horizontal rule.</p>
    	<hr>
    	<p>This is some text below the horizontal rule.</p>
    </body>
    </html>

HTML line break

In HTMl, line breaks are defined by the ‘<br>’ tag. This tag creates a single line, break. When can be used to insert the a line break within a paragraph then used the ‘<br>’ tag. Becase <br> tag add line break or new line without starting a new paragraph.

<!-- HTML line Break -->
    <!DOCTYPE html>
    <html>
    <head>
    	<title>Example Line Break</title>
    </head>
    <body>
    	<p>This is some text before the line break.<br>This is some text after the line break.</p>
    </body>
    </html>
    

In the above example, created an HTML page with a line break within a paragraph. The <br> tag is used to create line break.

When the page is rendered in a web browser, the text before and after the <br> tag will be displayed on separate lines, with a single line space between them.

<br/> tag is a self-closing tag in HTML 5.

<!-- Self closing <br/> tag -->
    <!DOCTYPE html>
    <html>
    <head>
    	<title>Example Line Break</title>
    </head>
    <body>
    	<p>This is some text before the line break.<br />This is some text after the line break.</p>
    </body>
    </html>
    
🖤 0
Buy me coffee ☕

Comments

Oops!

No comments here...