grayscale photo of laptop computer

Intro To HTML

What is HTML?

HTML is one of the three main languages used in creating web pages. It is the standard markup language that gets translated by your web browser and is typically used along with a styling language known as CSS (Cascading Style Sheet) and a programming language called JavaScript.

Typical web pages will include items like titles, subtitles, navbars, links, images, videos, forms, buttons, etc. Each of the items on a web page are created using HTML markup.

Hypertext Markup Language

HTML is short for Hypertext Markup Language. Though it may sound complicated, it is really just a text document containing special markup. The markup is written between angle brackets < > and are referred to as tags. These tags are used to create HTML elements. In the example below you can see a few common elements.

<html>
    <body>
        <h1>Header text</h1>
        <p>Paragraph text</p>
    </body>
</html>

Most elements, like the ones above contain an opening tag and a closing tag. Notice the closing tags contain a forward slash right after the first angle bracket.

More About Tags

Tags can contain attributes. An attribute provides information about an element. For example, you may want to give an element a unique id or a specific class that can be used to style the text a certain way.

<html>
    <body>
        <h1 id="main-header">This is the main header</h1>
        <p id="main-text" class="red-text">This text will be red</p>
    </body>
</html>

Each attribute is made up of a name and a value. The h1 element shown above has an attribute named id with a value of main-header. Notice the p tag has two attributes. Elements can have multiple attributes separated by a space.

Summary

HTML is a text based markup language used to build web pages. Elements are created using tags. Attributes can be added to an opening tag to provide information about an element.

Leave a Reply