Ads

Breaking

Monday, July 20, 2020

Horizontal line tag in HTML

In an article horizontal lines are used to visually break-up two sections e.g. if there are two paragraph may be they are separated from each other by a horizontal line . the tag which is used to create a horzontal line in a HTML document is <hr /> . This tag creates a line from the current position to the right and breaks the line .

This tag is an example of empty element as to use this tag you would not need paired tags i.e. opening and closing tags , as there is nothing to go in between them .

Step by step process to insert a horizontal line in a document is as follows :-

1. Open your text editor .

2. Write basic tags i.e. html , head , body . use title tag to write "Horizontal line example" in head section in order to understand which type of document you have made .
 

3.Write the paired paragraph tag inside body tag i.e. <p> and </p> and write paragraph you want to show the user in the main browsing area , to show I am writing "this is a paragraph 1 , this is a paragraph 2" .



4. Save this file with . html extension . I am saving this file as "Horizontal_line_break_example.html" .


5. To see the result how this looks like open the saved file in any browser to see the result . In point number 6 we will use </hr /> tag to  check the result .


6. Use <hr /> tag between "this is a paragraph 1 and this is a paragraph 2" as "this is a paragraph 1 <hr /> this is a paragraph 2" .



7. Save the file as "Horizontal_line_break_example1.html" .



8. Open the saved file in any browser to see the result of Horizontal line break tag "<hr />" .


Related Post :- 

No comments:

Post a Comment