Hypertext Markup Language

HTML is a “markup language” originally designed to describe structured documents for the web.

If you look at the pages of a book or the print out of your term paper, you will see a set of common conventions that we use to communicate structure and meaning. Document features such as headings, paragraphs, lists, or italics are represented on the page by distinctive styling. HTML provides a way to formally mark those types of document elements, in theory allowing you to record the semantic structure of the text. The markup can then be translated by the web browser into visual styles for easy reading.

Of course, as web pages become ever more complicated, HTML has gone far beyond a simple document language!

Pointy Brackets

HTML is made up of a set of standard elements used to structure a web page and introduce features such as images.

Elements are represented by tags enclosed by pointy brackets. Elements may have attributes inside the brackets that add additional data or qualifications to the tag. Elements are hierarchical, and may enclose content, which is nested between the opening and closing tag.

<tag attribute="value">content example</tag>

Every HTML file starts with the doctype declaration which tells your web browser what type of file to expect:

<!DOCTYPE html>

After the doctype, the first tag of every web page is the root element <html>. The rest of the content is nested inside the root element, so the final tag on every HTML file will be </html>.

Write HTML

To create a web page we will use GitHub Pages free hosting service. Any GitHub repository can create a static website and once activated will automatically appear in the github.io domain following the pattern:

https://username.github.io/repositoryname/

So let’s get started! All the GitHub steps are below for reference, with the HTML examples following.

1. Create a new repository on GitHub

2. Activate GitHub Pages

3. Create a new file in the repo

4. Keep editing!

Basic HTML

We will start with an index.html file because by default the server provides index as the home page of your site. Our basic page, introducing head, title, body, headings, and paragraphs:

<!DOCTYPE html>
<html>
    <head>
        <title>Hello World!</title>
    </head>
    <body>
        <h1>Hello World!</h1>
        <p>gh-pages is great.</p>
    </body>
</html>

Add Elements

<ul>
    <li>cats</li>
    <li>dogs</li>
    <li>muffins</li>
</ul>

<ol>
    <li>cats</li>
    <li>dogs</li>
    <li>muffins</li>
</ol>

Resources