What is HTML?
HTML is short for HyperText Markup Language. That doesn’t really say much, but HTML is just a text file using a special structure for describing the contents of a web-page. HTML isn’t a programming language in the sense that it can ‘do’ anything (it doesn’t contain any logic per-se), it’s just a set of rules that you use to describe what elements should appear on a single webpage.
A very simple example of HTML is this simple webpage which simply consists of a title and some text. The content of that page might look something like this;
<html>
<body>
<h1>My First Website</h1>
<p>Here is some text that I want to appear under the page title!</p>
</body>
</html>Exercise: Try pasting the code above into your index.html file in Brackets. Make sure you save it then click on the “Live Preview” button in the top right. You should see a very basic webpage appear!
As shown above, the majority of HTML consists of sections of text surrounded by tags which describe the function of the text between there. Here, the text enclosed between <h1>…</h1> tags is meant to be the page header (there are header tags from h1 to h6). The <p>…</p> says that what’s inside is a paragraph of normal text.
My First Website
Here is some text that I want to appear under the page title!
HTML pages are primarily made up of special markers which describe what should appear on the page. These markers/elements are called tags and always look something like this; <html>
Tags typically come in 2 forms - they usually have a ‘start’ and ‘end’ tag, which is used to say that everything between these two tags has a certain property. In the above example, you will notice that all of the tags come in pairs <h1>Some Content</h1>. This pair of tags state that the text between the tags should be considered as a major header (like a page title).
There is a vast range of tags that you can use to make all sorts of special things appear on your pages, from buttons and edit boxes to tables and images. We won’t spend too much time on this course learning HTML as we’re focusing on JavaScript and Game Development, but if you’re interested in learning more to spruce up your page - there are a couple of optional quests that go into more detail.
You can also check out the following pages if you want to learn more in your own time;