Skip to content
Frank Matranga edited this page Jan 11, 2020 · 2 revisions

What is HTML?

HTML stands for Hypertext Markup Language. Note that it is not a "programming" language but a "markup" language. HTML is a simple, easy-to-learn, language for defining the content and structure of a webpage.

It consists of tags that wrap around or "markup" text to give them meaning. Tags look like <tag> where tag is the usually short name of the tag, of which there are many! Most tags wrap around content such as other tags and/or text with an open and close tag <tag>content</tag>. Note the use of forward slash / and not the backslash \. A tag with its content is called an element. Remember that name, it is used very often!

MDN image of HTML element

NOTE: Forgetting the closing tag (</tag>) of an element is a common mistake that can mess up your document and be hard to locate!

Let's look at some examples...

Paragraphs

<p>Hello world! This is a paragraph.</p>

Bold Text

<strong>This text is BOLD!</strong>
<b>This is also bold but is an outdated tag.</b>

Italics

<em>This text is italicized for (em)phasis.</em>
<i>Same here, but this tag is also outdated. Prefer the other one!</i>

NOTE: HTML tags are not case sensitive, so <p> is the same as <P>. However, it is convention to use all lower-case.

Quick Review answers at bottom

  1. Is HTML a programming language?
  2. What is HTML used for?

Nesting Elements

HTML wouldn't be very useful if all you could have was paragraphs followed by bold text followed by other tags and so on. Therefore, you can nest elements inside of each other:

<p>
	This is a <em>nice<em> paragraph about some topic interesting to me. Maybe food... I'm <strong>hungry</strong> right now.
</p>

Attributes

Empty Elements

There are a variety of elements that don't wrap around any text or other elements but stand on their own. These elements simply have an open tag but no close tag. Here are some examples:

Images

<img src="/path/to/img" title="This text appears when you hover over the image!">
<br>
<hr>

Review Questions 3. Do all elements have an open and close tag? 4. How do we add other information to elements?


Review Answers

  1. No! HTML is a markup language.
  2. HTML is used to define the content and structure of a webpage.