Intro to HTML

In this lesson, we’ll learn the purpose of HTML and how to build a simple website using basic HTML tags.

What is HTML?

HTML, or Hypertext Markup Language, is a language that is used to create the structure and content of a website.

It is a way of describing the information that is contained on a webpage and how that information is organized and presented.

When you visit a website, your web browser reads the HTML code that makes up the webpage and uses it to display the content on your screen. Similar to the frame of a building: It provides a basic structure for where things go.

Untitled

HTML Elements

HTML consists of a series of elements or tags that are used to indicate different parts of a website, such as headings, paragraphs, and links.

For example, in the sandbox below, the <p></p> tag is used to indicate a paragraph and the <button></button> tag is used to indicate a button.

https://mirio.org/embed/s/html-intro-01250642gzna

Most elements in an HTML document like the ones above are wrapped in opening and closing tags. Opening tags are wrapped in < > and include the tag name and attributes. Closing tags are wrapped in </ > and include the tag name.

Untitled

There are also self-closing tags. Those do not require a closing tag. One of the most common self-closing tags is the image tag.

<img>

Another important property of HTML is that you can nest elements inside of each other, giving them a hierarchical relations. When you do this, you should indent the inner elements to make it easier to see the hierarchy of the document.

<section>
	<div>
		<p> Paragraph One </p>
	</div>
	<button> Click Me! </button>
</section>

HTML Attributes