3. HTML Tags
HTML has an extensive set of tags. A tag is used to help define and format content. HTML can also create hyperlinks, which is at the heart of the World Wide Web.
Some are described below as examples. The full specifications can be found at https://www.w3.org/
a) Tags to define parts of the page
TAG | Purpose |
---|---|
<!DOCTYPE html > | This tells the browser to treat the file as a web page |
<html> .......... </html> | This pair of tags define the start and end of a html document. |
<head> ............... </head> | The head section contains initial information the page may require. For example its title, styling, active code such as javascript. |
<body> ...................... </body> | This is where the main content of the page resides |
b) Tags to define parts of the text
TAG | Purpose |
---|---|
<h1> ................... </h1> | Text inside these pair of tags are formatted as Header 1, this is usually the biggest and most prominent kind of titled content on the page. |
<h2> .......... </h2> | Text inside this pair is a slightly smaller Header 2 format |
<p> ............... </p> | This is the bread and butter text format, namely the paragraph |
c) Tags to define structured text
TAG | Purpose |
---|---|
<table> <tr> <td> ....... </td> </tr> </table> | The outer definition of a table. This needs to include row and column tags as well. |
<ul> <li> ..... </li> </ul> | An unordered list . This needs line item tags as well. |
c) Tags to define images and hyperlinks
TAG | Purpose |
---|---|
<img src="lan.jpg" alt="lan" width="528" height="399"> | Image tag. The source file is pointed to by the src= attribute along with width and height information. If the file is missing, then the alt= text appears |
<a href="home.htm">home</a> | Tag for a hyperlink. The attribute href= points to another file or page. The text between the <a> </a> is shown on the page |
Challenge see if you can find out one extra fact on this topic that we haven't already told you
Click on this link: HTML tags