Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

HTML elements give a page its structure and meaning; tags are the markup notation used to write those elements. CSS does not attach a list of styles directly to each tag: selectors choose which elements a rule targets, and declarations pair CSS properties with values.

HTML tags and elements are related, but not identical

An HTML element is a structural or semantic unit in a document, such as a heading, paragraph, link, or list. Tags are the syntax that marks an element in HTML. For example, <p> is a start tag and </p> is an end tag; together with the content between them, they express a paragraph element.

HTML references cover more than element names. They also explain attributes, which provide additional information or behavior for an element, and global attributes, which can apply across many kinds of elements. The MDN HTML reference is organized for explanatory lookup, while the WHATWG HTML Living Standard is the standards-level specification.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Browse HTML by what an element does

When learning or looking up markup, grouping elements by function is more useful than memorizing one long alphabetic list. MDN’s HTML elements reference organizes elements into functional categories, helping you find the right kind of element for the content or task at hand.

How do you find which styles apply to an HTML element?

A common question is, “Is there a good reference to determine which styles can be associated with HTML elements?” The practical answer is to look up the CSS property you want in a CSS reference, then determine which elements your selector targets. A property reference explains the property and its values; the selector in your rule determines where those declarations apply.

A CSS rule combines a selector with one or more declarations. Each declaration pairs a property with a value. For example:

Rank #2
Sale
HTML and CSS: Design and Build Websites
  • HTML CSS Design and Build Web Sites
  • Comes with secure packaging
  • It can be a gift option
p {
  color: navy;
}

Here, p is the selector, color is the property, and navy is its value. The rule targets paragraph elements and sets their text color. The MDN CSS reference is an explanatory index for properties and the other parts of CSS used to write and understand rules.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Look beyond the property list

CSS references cover several kinds of material, not just properties. Depending on what you are trying to understand, you may need to look up:

  • Selectors: patterns that identify the elements a rule targets.
  • Pseudo-classes and pseudo-elements: selector features for targeting particular states or parts of elements.
  • Properties: the characteristics a declaration sets.
  • Data types and functions: the kinds of values CSS accepts and the ways values can be calculated or constructed.
  • At-rules: CSS instructions that control how stylesheets are interpreted or applied.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

MDN or the WHATWG standard: which reference should you use?

Reference Best for Organization Scope
MDN HTML reference and MDN CSS reference Explanatory, task-friendly lookup Indexes for HTML elements and CSS reference categories HTML and CSS
WHATWG HTML Living Standard Standards-level detail about HTML Normative standard text HTML

For an everyday question—what an element is for, how a CSS property works, or which selector syntax to use—start with the relevant MDN index. Consult the WHATWG standard when you need the normative HTML definition or more precise standards detail. The WHATWG page is the HTML standard; it is not a CSS reference.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.