Heading tag and title in html reference | center, break line, paragraph


heading tag and title in html reference | center,break line,paragraph tag

Heading tag in html reference | tag and title | example

Any document begins with the heading that you can use different sizes for your titles, therefore HTML has six levels of headings, which is use elements <h1>, <h2>, <h3>, <h4>, <h5>, and <h6>. When displaying any heading. The browser first adds a line and then a heading.

Examples

<! DOCTYPE html>

<html>

<head>

<title> title example </title>

</head>

<body>

<h1> this is the top 1 </>

<h2> this is 2 </>

<h3> it is titled 3 </>

<h4> This is 4 </>

<h5> this is 5 </>

<h6> his is the top 6 </>

</Body>

</html>

Result-

heading tag and title in html
title tag in html reference

Paragraph tag in html reference | tag and title example

The <p> tag provides a way to structure your text into different paragraphs but each paragraph of the text must go between an opening <p> and a closing </p> tag as shown in the example below so see below –

Examples

<! DOCTYPE html>

<html>

<head>

<title> paragraph example </title>

</head>

<body>

<p> Here is the first paragraph of the text. </p>

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

<p> Here is the third paragraph of the text. </p>

</Body>

</html>

Result –

Paragraph tag in html reference
Paragraph tag in html reference

Break line tag in html reference | tag and title example

Whenever you use the <br /> element, after that, the next line will start. This tag is an example of an empty element, where you do not need to open and close the tag because there is nothing to move between them.

<br /> tag has a space between the letter br and the forward slash. if you leave this space, In older browsers will have trouble giving line breaks, Whereas if you miss the forward slash character and only use <br> it is not valid in XHTML.

so example are given below-

<! DOCTYPE html>

<html>

<head>

<title> line break example </title>

</head>

<body>

<p> Hello <br />

You gave your work on time. <br />

Thanks <br />

Mahnaz </p>

</Body>

</html>

Result –

Line break tag in html reference
Line break tag in html reference

Center tag and title in html | paragraph tag and title tag

You can use the <center> tag to place any content in the center of a page or a table cell. Example is given below- so see it

Examples

<! DOCTYPE html>

<html>

<head>

<title> focused content example </title>

</head>

<body>

<p> This text is not in the center. </p>

<center>

<p> This text is in the center. </p>

</center>

</Body>

</html>

Result –

Center tag and title in html with example
Center tag and title in html with example

Horizontal lines and title in html | tag and title example

Horizontal lines are used for the break up sections of a document. The <hr> tag creates a line from the current position in the document to the correct margin and breaks the line accordingly.

For example below you might want to give a line between two paragraphs –

Examples

<! DOCTYPE html>

<html>

<head>

<title> horizontal line example </title>

</head>

<body>

<p> This paragraph is one and should be at the top </p>

<hr />

<p> This paragraph is two and should be below </p>

</Body>

</html>

Result –

Horizontal lines and title in html with example
Horizontal lines and title in html with example

Again the <hr /> tag is an example of an empty element, where you do not need to open and close the tag, because there is nothing to go between them.

The <hr /> element has a space between the character hr and the forward slash. If you omit this space, older browsers will have trouble rendering the horizontal line, whereas if you miss the forward slash character and just use <hr>, it is not valid in XHTML

Preserve formatting in html reference | tag and title | example

So-metimes, you want your text to follow the exact format written in the HTML document. In these cases, you can use the tag already tagged <pre>.

Any text between the initial <tag> and closing </ex> tags will preserve the formatting of the source document. Therefore example is given below-

Examples

<! DOCTYPE html>

<html>

<head>

<title> Preserve formatting example </title>

</head>

<body>

<pre>

Function test (strText) {

Warning (strText)

}

</pre>

</Body>

</html>

Result –

Preserve formatting in html reference
Preserve formatting in html reference

Try to use the same code without placing it inside the <pre> … </pre> tag

Non breaking space in html | tag and title | examples

Suppose you want to use the phrase “12 angry men”. so here, you wouldn’t want a browser to split “12, Angry” and “Main” into two lines –

 For example of this technique appears in the film “12 Angry Men”.

so In cases where you do not want the client browser to break the text, you should use a non-breaking space unit. & Nbsp; Instead_of a common locations and for example, when coding “12 Angry Men” in a paragraph. You should use something similar to the following code.

For Example

<! DOCTYPE html>

<html>

<head>

<title> unbearable spaces example </title>

</head>

<body>

<p> An example of this technique appears in the film “12&nbsp;Angry&nbsp;Men.”</p>

   </body>

</html>

Result −

Non breaking space in html
Non breaking space in html

heading tag and title in html reference | center,break line,paragraph tag

Recommended post:

so https://www.w3schools.com/html/html_examples.aspso

https://html.com/

https://www.w3schools.com/tags/tag_code.asso

so https://www.w3schools.com/html/so

Have any Question or Comment?

Leave a Reply

Your email address will not be published. Required fields are marked *

Categories