Coding Ireland STEM Report 2024 Have Your Say
HTML
Advanced
30 mins
275 points
What you need:
  • Computer/laptop

HTML Basic Elements

In this lesson we take a look at some of the basic HTML elements and what they do.

1 - Headings

HTML comes with 6 different heading tags <h1> to <h6>. The most important headings on a page use <h1>, the second most important headings use <h2> and so on.

2 - Paragraphs

Paragraphs are defined using the <p> tag. Each paragraph will go onto a new line with some space above and below it.

3 - Break

Breaks are defined using the <br> tag. This tag puts a line break wherever it's included.

4 - Images

Images are defined using the <img> tag. For each <img> tag we need to give some extra information for the location of the image file to show and the width and height. These are called attributes and they go inside the <img> tag.

  • src - this is the source or location of the image file to display.
  • width - we can say how wide the image should appear (in pixels or a percentage).
  • height - we can say how high the image should appear (in pixels or a percentage).

5 - Links

Links are used to 'link' to other web pages and they are defined using the <a> (anchor) tag. For each <a> tag we need to give some extra information for the location of where to link to as well whether to open a new tab or not. These are called attributes and they go inside the opening <a> tag.

  • href - this is the location of the web page we want to link to.
  • target - this says whether we open the link in the current tab or a new tab.

Whatever we put inside the <a></a> tags is what the browser will display as the link.

Join our club 😃

To view the remaining 1 steps and access hundreds of other coding projects please login or create an account.

Copyright Notice
This lesson is copyright of Coding Ireland. Unauthorised use, copying or distribution is not allowed.
🍪 Our website uses cookies to make your browsing experience better. By using our website you agree to our use of cookies. Learn more