HTML Tutorial

Tags

Basic HTML elements are made out of tags and content.

Tags are wrapped in angle brackets. The first tag is called the opening tag. (Note: some elements only have one tag and are called empty elements.)

    

<tag>


    

The second tag is called the closing tag. The closing tag has a forward slash after the first angle bracket.

    

<tag></tag>


    

Content

For text elements, your text content goes in between the opening and closing tags.

    

<tag>Content goes here</tag>


    

Attributes

Some elements can have additional properties attached to them. These properties are called attributes. They go in the opening tag of an element (or the only tag if it's an empty element).

    

<tag attribute>Content goes here</tag>


    

Some attributes will be followed by an equals sign and a value in quotes. Sometimes the value is just an empty pair of quotes.

    

<tag attribute="">Content goes here</tag>


    
    

<tag attribute="value">Content goes here</tag>


    

You can have multiple attributes and values separated by a space.

    

<tag attribute="value" attribute="value">Content goes here</tag>


    

Here's an example of an empty element with multiple attributes.

    

<tag attribute="value" attribute="value">