A quick HTML primer
In the previous lessons, we tried out simple examples and rendered bland single-line responses. But thanks to HTML the web is a much more beautiful place than that. Take a look at the following HTML and run it to see how it is actually rendered:
Let us take a closer look at the example and understand some basic HTML. As you would have noticed, <h1> begins a 'heading' tag. There are multiple levels of headings: h1, h2, h3 and h4. Out of these, h1 has the largest text and h4 has the smallest. Once you begin a tag, you have to close it like this: </h1>.
The <p> tag is used to denote the beginning of a paragraph of text. Remember that HTML is space insensitive. That means even if you put multiple linespaces inside a text, they would be ignored. So we use the <p> tag to denote the beginning of a paragraph and </p> to denote the end.
And finally - the <a> and </a> tags. They as you might observe are used to create links to other URLs. You use the
href attribute to point to the URL and put the text you want to show inside the tags.
Feel free to play around with the HTML in the above example! You should also check out Mozilla's excellent HTML reference for an in-depth understanding of HTML.