Lesson 2 - Basic HTML elements

HTML Headings

HTML is comprised of 6 heading sizes: h1 to h6

h1 - Largest heading
h2 - Large heading
h3 - Medium heading
h4 - Small heading
h5 - Smaller heading
h6 - Smallest heading

HTML Paragraphs

Paragraphs are created using the p tags

<p>This is some text in a paragraph</p>

Hyperlinks are an extremely important part of the Internet and form the basis of how websites link to one another. Links are created using the a tag with the destination URL being set using the href attribute

<a href="http://base64.co.za">This is a link to a great website</a>

HTML Images

Links are created using the img tag with the source of the image being set using the src attribute. The alt attribute can be used to display alternative text while the image is loading. The width and height can also be specified as attributes.

<img src="https://base64.co.za/content/images/2017/05/base64logo.png" width="200px" height="60px">

It is often useful to have an image which links to a particular URL. This can be achieved as follows:

<a href="http://wiredin.co.za"><img src="https://base64.co.za/content/images/2017/05/base64logo.png" width="200px" height="60px"></a>

Output:

logo