Html documents; Tags, Elements and Structure

HTML stands for Hyper Text Markup Language. HTML is a language for describing web pages using tags.

Please see the tutorial World Wide Web, www or w3 for more information.

 

Below we can see an example of the source code of a webpage or HTML document:

 

<html>

<head>

<title>Hello World</title>

</head>

<body>

      <h1>Hello edu4java</h1>

      <p>Welcome to our first <br/> webpage. </p>

</body>

</html>

HTML Tags. What is a HTML tag?

HTML tags are keywords (tag names) surrounded by angle brackets like <html> or <head>. There are three types of tags:

  1. Start tag or opening tag. Example: <h1>
  2. End tag or closing tag. Example: </h1>
  3. Start and end tag. Example: <br/>

HTML Element

  1. An HTML element is everything from the start tag to the end tag. Example: <title>Hello World</title>
  2. The element content is everything between the start and the end tag
  3. A start and end tag is also an HTML element. Example: <br/>

 

The global structure of an HTML document

The first HTML tag of a webpage should be <html> and the last one </html>. This means all the webpage should be inside an HTML element.

 

Inside this HTML element, we have;

  1. the element "header", which will contain configuration information.
  2. and the element "body" which will contain all the visible part of our page.

Below we have the result after the Browser intreprets our source code (first paragraph):

 

 

In this example we can see how the element title inserts the title of the page which we can see in tab; Hello World.

Inside the body element we have an h1 element, which will insert the headline and a p element which inserts a paragraph. Inside the p element, we have a br element which inserts a line break.

 

 

 

As we can see inside the body element, we have both the information to display on the webpage as well as tags which indicate how to display the information.

<< Browser tutorial Web server or HTTP Server tutorial >>