Corge.dev

HTML

topic name here

note here

Elements

Anchor

Anchor element

Basic Example

download

Causes the browser to treat the linked URL as a download. Can be used with or without a filename value

Without a value

the browser will suggest a filename/extension

filename

defining a value suggests it as the filename

href

The URL that the hyperlink points to

referrerpolicy

How much of the referrer to send when following the link, e.g. no-referrer: the Referer header will not be sent

target

Where to display the linked URL (a tab, window, or <iframe>)

_self

current browsing context. (Default).

_blank

Open in a new tab.

<img>

embeds an image into the document.

Basic Example

src

The image URL. Mandatory for the <img> element.

srcset

One or more strings separated by commas.

sizes

One or more strings separated by commas.

media condition

This must be omitted for the last item in the list.

size

source size value

alt

Defines text that can replace the image in the page

fetchpriority

priority to use when fetching the image, Allowed values:

high

high-priority fetch relative to other images

low

low-priority fetch relative to other images

auto

automatic determination of fetch priority

height

height of the image, in pixels. Must be an integer without a unit.

width

width of the image, in pixels. Must be an integer without a unit.

loading

Indicates how the browser should load the image.

eager

Loads the image immediately, regardless of whether or not the image is currently within the visible viewport (this is the default value).

lazy

Defers loading the image until it reaches a calculated distance from the viewport, as defined by the browser

article

represents a self-contained composition

Basic Example

address

indicates that the enclosed HTML provides contact information

Basic Example

aside

presented as sidebars or call-out boxes.

Basic Example

blockquote

block quotation element

body

Document Body element

button

Button element

autofocus

if the button should have input focus

disabled

button unineractable

referrerpolicy

How much of the referrer to send when following the link, e.g. no-referrer: the Referer header will not be sent.

target

Where to display the linked URL (a tab, window, or <iframe>)

canvas

The Graphics Canvas element.

caption

The Table Caption element.

code

Inline Code element.

datalist

The HTML Data List element.

details

The Details disclosure element.

dialog

New March 2022

The Dialog element.

div

The Content Division element.

embed

The Embed External Content element.

figcaption

The Figure Caption element.

figure

The Figure with Optional Caption element.

footer

The Footer element.

form

The Form element.

<h1>-<h6>

The HTML Section Heading elements.

head

The Document Metadata (Header) element.

header

The Header element.

hgroup

The Heading Group element.

hr

The Thematic Break (Horizontal Rule) element.

html

The HTML Document / Root element.

iframe

The Inline Frame element.

input

The Input (Form Input) element.

kbd

The Keyboard Input element.

label

The Label element.

li

The List Item element.

link

The External Resource Link element.

main

The Main element.

meta

The metadata element.

meter

The HTML Meter element.

nav

The Navigation Section element.

noscript

The Noscript element.

object

The External Object element.

ol

The Ordered List element.

optgroup

The Option Group element.

option

The HTML Option element.

output

The Output element.

p

The Paragraph element.

picture

The Picture element.

pre

The Preformatted Text element.

progress

The Progress Indicator element.

script

The Script element.

search

New October 2023

The generic search element

section

The Generic Section element.

select

The HTML Select element.

source

The Media or Image Source element.

span

The Content Span element.

sub

The Subscript element.

summary

The Disclosure Summary element.

sup

The Superscript element.

table

The Table element.

tbody

The Table Body element.

td

The Table Data Cell element.

textarea

The Textarea element.

tfoot

The Table Foot element.

th

The Table Header element.

thead

The Table Head element.

title

The Document Title element.

tr

The Table Row element.

ul

The Unordered List element.

Attributes

accept

describing which file types to allow.

autocomplete

describing which file types to allow.

disabled

makes the element not mutable, focusable, or even submitted with the form.

for

it indicates the form element that this label describes.

max

defines the maximum value that is acceptable and valid for the input.

maxlength

defines the maximum string length that the user can enter into an <input>.

min

defines the minimum value that is acceptable and valid for the input.

minlength

defines the minimum string length that the user can enter into an <input>.

multiple

means the form control accepts one or more values. Valid for the email and file input types and the <select>.

pattern

specifies a regular expression the form control's value should match

placeholder

defines the text displayed in a form control when the control has no value.

readonly

when present, makes the element not mutable, meaning the user can not edit the control.

rel

defines the relationship between a linked resource and the current document.

required

if present, indicates that the user must specify a value for the input.

size

defines the width of the <input>.

step

number that specifies the granularity that the value must adhere to or the keyword any. It is valid for the numeric input types.

Input

button

rendered as simple push buttons

checkbox

rendered by default as boxes that are checked (ticked) when activated

color

provide a user interface element that lets a user specify a color

date

let the user enter a date, either with a textbox that validates the input or a special date picker interface

datetime-local

create input controls that let the user easily enter both a date and a time

email

let the user enter and edit an email address

file

let the user choose one or more files from their device storage to upload or manipulate.

hidden

let web developers include data that cannot be seen or modified by users

image

used to create graphical submit buttons

month

create input fields that let the user enter a month and year.

number

let the user enter a number. and reject non-numerical entries

password

provide a way for the user to securely enter a password

radio

used in radio groups—collections of radio buttons describing a set of related options.

range

let the user specify a numeric value which must be no less than a given value, and no more than another given value

reset

button that resets all inputs in the form to their initial values

search

text fields designed for the user to enter search queries into

submit

attempts to submit the form to the server

tel

used to let the user enter and edit a telephone number

text

create basic single-line text fields

time

create input fields designed to let the user easily enter a time (hours and minutes, and optionally seconds)

url

used to let the user enter and edit a URL

week

input fields allowing easy entry of a year plus the ISO 8601 week number during that year