HTML Glossary | Codecademy

Update: Cheat Sheets BETA is here!

class

HTML elements can have one or more classes, separated by spaces. You can style elements using CSS by selecting them with their classes.

Example

This is a big yellow box.

id

An HTML element can have an id attribute to identify it. id elements should always be unique to that single element, and each element should never have more than one id.

Example

This is my box! Put your text in some other box.

href

Links tell the browser where to go using an href attribute, which stores a URL.

Example

Google it!

You can easily format text to be bold, italic, or underlined using simple formatting tags.

Example

This text is bold, italicized, and underlined.

The body is the container for all of a page’s content. Comes after the tag, within the overall tag.

Example

An example of the body tag This is inside the body!

Read more

Usage

Almost all content belongs inside the body tag. The main exceptions are script and style tags, as well as the page title tag. As you can see in this example, there is a heading, an image, and a link all inside the body tag. The head tag contains only external files and the page title.

Example

My homepage

Hello, this is a picture of my cat!

[email protected]

“>Email my cat

An element that is an immediate descendent of another element or nested within another element is called a child. These become useful when using CSS child selectors and psuedo-elements.

Example

  • I’m a child of parent!

HTML comments are sometimes used in code to explain parts of the markup. They are similar to comments in other languages. Users do not see comments in their browser.

Syntax

A block level container (or ‘division’ of the web page) for content with no semantic meaning.

Syntax

This is a div element.

Tag that surrounds important content that is invisible to the user, but is important to the browser. Elements within this tag contain metadata about the page and links to stylesheets, scripts, etc.

Heading elements like

,

,

, … allow you to use six levels of document headings, ranging from largest to smallest, breaking up the document into logical sections. For example, the word ‘Headings’ above is wrapped in a

tag.

Syntax

This is a header!

This tag creates a black line one pixel thick that runs the all the way across its container. It can be styled to look differently with CSS.

Example

This text is divided


…from this text!

Read more

What is HTML?

HTML stands for Hyper Text Markup Language. It is the language used to create all websites.

Read more

tag

All HTML files live within an over-arching html tag. This is the basic tag that defines an html document.

Syntax

The rest of your web page goes in here!

Read more

Hyperlinks (or just links) take the user to another webpage when they click on it. The most common attribute used with links is href, which tells the browser where the link goes.

Syntax

Link text

Example

The following text is goes to Google.

The img tag embeds an image into your HTML. Always found with the ‘src’ attribute, which tells the browser where to find the image. Note that the tag is self-closing.

Syntax

This tag is used in a block of text to force a line break. This is to be used for things which are a single paragraph, but where this formatting is necessary such as poems or addresses. To separate paragraphs, separate each paragraph into a separate

element instead. The resulting element on a web page will look like:

Example

Some text
that spans two lines

Link elements are used to connect your document to a related resource (very different from hyperlinks, which take you to another webpage when you click on them). Links appear only in the head section of a document so they do not alter the content, but only the presentation. Links are most commonly used to connect to a stylesheet, script, favicon, or alternate format of the page such as an RSS feed or PDF.

Example

HTML supports two kinds of lists: ordered lists and unordered lists. Within lists each individual list item has its own tag.

Unordered Lists

Unordered lists are just lists whose items are denoted with bullet points.

Example

Shopping list

  • Dish soap
  • Kitty litter
  • Tomato sauce

Read more

Ordered Lists

Ordered lists’ items are denoted with numbers.

Example

My numbered list

  1. First item!
  2. Second item!
  3. Last item!

Read more

One of the most common tags in HTML – it denotes a paragraph of text. It often has other elements nested inside of it, such as , , and .

Syntax

This is paragraph text!

These tags are similar to the previously mentioned formatting tags which have fallen out of favor. The difference is that these tags have semantic value (meaning). is used for something that you wish to emphasize and is used for something that is important. With both of these elements, you can convey the level of emphasis or importance with nesting. The more times that you nest the element within itself, the higher the magnitude of the text it contains.

Example

Warning:Acid can cause severe burns

An element for displaying information in rows and columns. Supports headers and footers for labeling columns. Divides information into rows (denoted by the tr tag) which contain cells (denoted by the td tag).

Example

Item Price
Banana $56.75
Yogurt $12.99
Total $69.74

Tags are basic labels that define and separate parts of your markup into elements. They are comprised of a keyword surrounded by angle brackets <>. Content goes between two tags and the closing one is prefixed with a slash (Note: there are some self-closing HTML tags, like image tags). Tags also have attributes, which are

Syntax

content

This tag tells the browser what to display as the page title at the top and tells search engines what the title of your site is. It goes inside tags. Try and make your page titles descriptive, but not overly verbose.

Example

HTML Glossary

Source

Leave a Reply

Your email address will not be published. Required fields are marked *