Attribute | Description |
class | Defines one or more class names for an element. See Classes and IDs. |
contenteditable | Sets whether the content of an element can be edited. |
contextmenu | Defines a context menu shown when a user right-clicks an element. |
dir | Sets the text direction for text within an element. |
draggable | Sets whether an element can be dragged. |
hidden | Hides an element not currently in use on the page. |
id | Defines a unique identifier for an element. See Classes and IDs. |
lang | Defines the language of an element’s content and its text attribute values. See Content Languages. |
spellcheck | Sets whether to spell/grammar check the content of an element. |
style | Defines a set of inline CSS styles for an element. |
tabindex | Sets the order in which elements on a page are navigated by the tab keyboard shortcut. |
title | Defines additional information about an element, generally in the form of tooltip text on mouseover. |
translate | Defines whether to translate the content of an element. |
Chapter 36: Tabindex
Value | Meaning |
negative | element will be focusable, but it should not be reachable via sequential keyboard navigation |
0 | element will be focusable and reachable through keyboard sequential navigation, but it’s relative order is defined by the platform convention |
positive | element must be focusable and accessible via sequential keyboard navigation; it’s relative order will be defined by the attribute value: the sequential follow the increasing number of the tabindex |
Chapter 35: Marking-up Quotes
Inline with <q>
The q element can be used for a quote that is part of a sentence:
<p>She wrote <q>The answer is 42.</q> and everyone agreed.</p>
Chapter 34: Marking up computer code
Block with <per> and <code>
If the formatting (white space, new lines, indentation) of the code matters, use the pre element in combination with
the code element:
Chapter 33: Meta Information
Meta tags in HTML documents provide useful information about the document including a description, keywords,
author, dates of modifications and around 90 other fields. This topic covers the usage and purpose of these tags.
Chapter 32: Canvas
Attribute | Description |
height | Specifies the canvas height |
width | Specifies the canvas width |
Chapter 31: SVG
SVG stands for Scalable Vector Graphics. SVG is used to define graphics for the Web
The HTML <svg> element is a container for SVG graphics.
SVG has several methods for drawing paths, boxes, circles, text, and graphic images.
Inline SVG
SVG can be written directly into a HTML document. Inline SVG can be styled and manipulated using CSS and
JavaScript.
Chapter 30: Content Languages
Base Document Language
It’s a good practice to declare the primary language of the document in the html element:
<html lang="en">
If no other lang attribute is specified in the document, it means that everything (i.e., element content and attribute
text values) is in that language.
If the document contains parts in other languages, these parts should get their own lang attributes to “overwrite”
the language declaration.
Chapter 29: IFrames
Attribute | Details |
name | Sets the element’s name, to be used with an a tag to change the iframe’s src. |
width | Sets the element’s width in pixels. |
height | Sets the element’s height in pixels. |
src | Specifies the page that will be displayed in the frame. |
srcdoc | Specifies the content that will be displayed in the frame, assuming the browser supports it. The content must be valid HTML. |
sandbox | When set, the contents of the iframe is treated as being from a unique origin and features including scripts, plugins, forms and popups will be disabled. Restrictions can be selectively relaxed by adding a space separated list of values. See the table in Remarks for possible values. |
allowfullscreen | Whether to allow the iframe’s contents to use requestFullscreen( ) |
Chapter 28: Embed
Parameters | Details |
src | Address of the resource |
type | Type of embedded resource |
width | Horizontal dimension |
height | Vertical dimension |