HTML is a standard markup language used mainly for constructing webpages. HTML stands for HyperText Markup Language.
Interestingly, HTML is not considered a programming language as it doesn't contain dynamic functionality.
The three main parts of an HTML element are:
- Opening tag
- Content
- Closing tag
EXERCISE
Create a paragraph containing the worlds 'Hello World' using the following code, <p>i am in a p tag</p>. The result is:
Hello World
Try it yourself!
The HTML <p> element defines a paragraph. A paragraph always starts on a new line, and browsers automatically add some white space (a margin) before and after a paragraph.
HTML DISPLAY
You cannot be sure how HTML will be displayed.
Large or small screens, and resized windows will create different results.
HTML, you cannot change the display by adding extra spaces or extra lines in your HTML code.
The browser will automatically remove any extra spaces and lines when the page is displayed:
Search engines use the headings to index the structure and content of your web pages.
Users often skim a page by its headings. It is important to use headings to show the document structure.
<h1>
headings should be used for main headings, followed by
<h2>
headings, then the less important
<h2>
,
and so on.
HTML links are hyperlinks. You can click on a link and jump to another document. When you move the mouse over a link, the mouse arrow will turn into a little hand.
The HTML <a> tag defines a hyperlink. It has the following syntax:
<a href="url">link text </a>
The most important attribute of the <a> element is the href attribute, which indicates the link's destination. The link text is the part that will be visible to the reader. Clicking on the link text, will send the reader to the specified URL address.
By default, links will appear as follows in all browsers:
- An unvisited link is underlined and blue
- A visited link is underlined and purple
- An active link is underlined and red