Thursday, May 11, 2017

HTML Basic Tags


Hello dear readers! welcome back to another section of my tutorial on Html. In this section of my tutorial post, we are going to be discussing about the basic tags of Html.

Heading Tags

Every Html document starts with the heading. You can use different sizes for your headings. Html has six levels of headings, which use the elements <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, while displaying any heading, the web browser adds one line before and one line after that heading.

RECOMMENDED POST: The Doctype Declaration

Example


<!DOCTYPE html>
<html>

     <head> 
            <title>Tutorial on headings</title>
     </head>

     <body>
            <h1>This is the first heading</h1>
            <h2>This is the second heading</h2>
            <h3>This is the third heading</h3>
            <h4>This is the fourth heading</h4>
            <h5>This is the fifth heading</h5>
            <h6>This is the sisth heading</h6>
     </body> 

</html>

Feel free to try out the above code on your text editors to see the results for yourselves.

Paragraph Tags

The <p> (paragraph) tag offers you a way to structuring your texts into various paragraphs. Every single paragragh of your texts should go in between an opening <p> and also a closing </p> tag as shown below.

Example


<!DOCTYPE html>
<html>

     <head> 
            <title>Tutorial on paragraph</title>
     </head>

     <body>
            <p>This is the first heading</p>
            <p>This is the second heading</p>
     </body> 

</html>

Feel free to try out the above code on your text editors to see the results for yourselves.

Line Break Tag

Whenever the <br /> element is used, anything following it starts from the next line. This tag is a very good example of the empty element, where you do not need any opening and closing tags as there is nothing to go in between.

The <br /> tag has a space that goes between the characters br and forward slash. If you omit this space, older browsers will have troubles rendering the line break, while if you miss the forward slash character and use just <br> it is not valid in XHTML. You can try the example below.


Example


<!DOCTYPE html>
<html>

     <head> 
            <title>Tutorial on line break</title>
     </head>

     <body>
            <p>The author of this blog is KENNEDY<br />
                   a citizen of NIGERIA in west africa<br />
                   Thanks for visiting my blog </p>
     </body> 

</html>

Feel free to try out the above code on your text editors to see the results for yourselves.

Centering Content

You can use <center> tag to put any content in the center of the page or any table cell

Example


<!DOCTYPE html>
<html>

     <head> 
            <title>Tutorial on Centering</title>
     </head>

     <body>
            <p>This is the first paragraph</p>
            <center> 
                  <p>This is the second paragraph which has been centered</p>   
            </center> 
     </body> 

</html>

You can text run the above code to see results

Alright guys, this is where we will be wrapping it up on this tutorial guide. We will continue with the rest of the Html tags in my next tutorial guide. GOODLUCK!!
Share:

0 comments:

Post a Comment

Hello dear readers! Please kindly try your best to make sure your comments comply with our comment policy guidelines. You can visit our comment policy page to view these guidelines which are clearly stated. Thank you.