HTML Language Web Programming

HTML Basic Tags Tutorial

HTML Tag

HTML Heading Tags

The HTML tag is one of the fundamentals of HTML languages, any document or web page starts with a heading. You can use different sizes for your headings. There are six levels for HTML headings, which use the elements <h1>, <h2>, <h3>, <h4>, <h5>, and <h6>. While displaying any heading, the web browser adds one line before and one line after that heading.

<!DOCTYPE html>
<html>

   <head>
      <title>Heading Example</title>
   </head>
	
   <body>
      <h1>This is heading 1</h1>
      <h2>This is heading 2</h2>
      <h3>This is heading 3</h3>
      <h4>This is heading 4</h4>
      <h5>This is heading 5</h5>
      <h6>This is heading 6</h6>
   </body>
	
</html>

This HTML code will produce the following result:

This is heading 1

This is heading 2

This is heading 3

This is heading 4

This is heading 5
This is heading 6

HTML Paragraph Tag

The <p> tag offers a way to structure your text in the page into different paragraphs. Each paragraph of text should go in between an opening tag <p> and a closing tag </p>

<!DOCTYPE html>
<html>

   <head>
      <title>Paragraph Example</title>
   </head>
	
   <body>
      <p>Here is the first paragraph of text.</p>
      <p>Here is the second paragraph of text.</p>
      <p>Here is the third paragraph of text.</p>
   </body>
	
</html>

This HTML code will produce the following result:

Here is the first paragraph of text.

Here is the second paragraph of text.

Here is the third paragraph of text.

 

Line Break Tag

When you start to use the <br /> element, anything following it starts from the next line. This HTML tag is an example of an empty element, where you don’t need opening and closing HTML tags, as there is nothing to go in between them.

The < br/ > tag has a space between the br and forward slash characters.. If you omit this space, older browsers will have trouble rendering the line break, while if you miss the forward slash character and just use <br> it isn’t valid in XHTML.

<!DOCTYPE html>
<html>

   <head>
      <title>Line Break  Example</title>
   </head>
	
   <body>
      <p>Hello<br />
         Did you finish your work?<br />
         Thanks<br />
         Alex</p>
   </body>
	
</html>

This code will produce the following result:

Hello
Did you finish your work?
Thanks
Alex

HTML Centering Content

Using centering content means that you should use <center> tag to put any content in the center of any page or any table cell

<!DOCTYPE html>
<html>

   <head>
      <title>Centring 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>

This HTML code will produce the following result:

This text is not in the center.

This text is in the center

 

HTML Horizontal Lines

To visually break up parts of a document, horizontal lines are used. The tag < hr > generates a line to the right margin from the current position in the document and breaks the line accordingly.

<!DOCTYPE html>
<html>

   <head>
      <title>Horizontal Line Example</title>
   </head>
	
   <body>
      <p>This is paragraph one and should be on the top</p>
      <hr />
      <p>This is paragraph no.2 and should be at the bottom</p>
   </body>
	
</html>

This HTML code will produce the following result:

This is paragraph one and should be on the top


This is paragraph no.2 and should be at the bottom

 

HTML Link Tag

Defines the HTML tag Link in internal or External document. HTML tag for Link are defined inside the <a> tag

<body>
<a href="http://www.bibloteka.com">Learning Website</a>
</body>

This HTML code will produce the following result:

Learning Website

See Also

How to Create a Web page Using HTML

error: Content is protected !!