Web Development Reference

HTML & CSS Cheat Sheets

Converted into the same previous HTML reference format, with left navigation, responsive tables, formatted code elements, and the original cheat-sheet images preserved for visual reference.

Included: HTML basic tags, text formatting, headings, comments, links, images, tables, lists, forms, media and layouts, plus a comprehensive CSS property/selector reference covering syntax, selectors, backgrounds, borders, text, flexbox, grid, transitions, transforms, animations and more.

HTML Cheat Sheet

HTML Basic Tags

Element / PropertyDescription
<!DOCTYPE>Defines the type of the document.
<html>...</html>Root of an HTML document.
<head>...</head>Container for all the metadata about an HTML document.
<title>...</title>Defines the title for the document.
<meta />Defines metadata like character set, viewport, keywords, page description, author, etc.
<base />Specifies the default URL for all links on a page.
<link />Defines links to external sources.
<style>...</style>Defines style for a document.
<script>...</script>Defines client-side scripts.
<noscript>...</noscript>Specifies alternate content if the browser does not support scripts.
<body>...</body>Represents the main body of a document.

HTML Text Formatting

Element / PropertyDescription
<p>...</p>Paragraph
<br />Single line break
<hr />Horizontal Rule
<b>...</b>Bold Text
<i>...</i>Italic Text
<small>...</small>Smaller Text
<mark>...</mark>Marked / Highlighted Text
<del>...</del>Deleted Text
<ins>...</ins>Inserted Text
<strong>...</strong>Important Text
<em>...</em>Emphasized Text
<sub>...</sub>Subscript
<sup>...</sup>Superscript
<blockquote>...</blockquote>Block Quotation
<q>...</q>Inline Quotation
<abbr>...</abbr>Abbreviations / Acronyms
<address>...</address>Address
<cite>...</cite>Citation
<bdo>...</bdo>Changes text direction
<code>...</code>Programming Code
<pre>...</pre>Preformatted Text
<samp>...</samp>Sample output of a program
<kbd>...</kbd>Keyboard Input
<var>...</var>Variable
<dfn>...</dfn>Definition
<meter>...</meter>Scalar Measurement
<progress>...</progress>Progress bar
<u>...</u>Underlined Text

HTML Headings

Element / PropertyDescription
<h1>...</h1>Heading One
<h2>...</h2>Heading Two
<h3>...</h3>Heading Three
<h4>...</h4>Heading Four
<h5>...</h5>Heading Five
<h6>...</h6>Heading Six

HTML Comments

Element / PropertyDescription
<!-- Single Line comment -->Single-line comment
<!-- ... -->Multiple-lines comment

HTML Images

Element / PropertyDescription
<img />Image
<map>...</map>Image Map with clickable area
<area />Clickable Area in <map>
<picture>...</picture>Group of pictures
<figure>...</figure>Figures / Diagrams / Illustrations
<figcaption>...</figcaption>Caption for <figure>
<canvas>...</canvas>Graphics
<svg>...</svg>SVG graphics

HTML Tables

Element / PropertyDescription
<table>...</table>Table
<tr>...</tr>Table Row
<th>...</th>Table Header Cell
<td>...</td>Table Data
<caption>...</caption>Table Caption
<thead>...</thead>Group of header contents
<tbody>...</tbody>Group of body contents
<tfoot>...</tfoot>Group of footer contents
<colgroup>...</colgroup>Group of columns
<col />Column in a <colgroup>

HTML Lists

Element / PropertyDescription
<ul>...</ul>Unordered List
<li>...</li>List Item
<ol>...</ol>Ordered List
<dl>...</dl>Description List
<dt>...</dt>Terms of the description list
<dd>...</dd>Describe each term of the description list

HTML Forms

Element / PropertyDescription
<form>...</form>HTML Form
<input />Input Field
<label>...</label>Label for an input element
<button>...</button>Clickable button
<textarea>...</textarea>Multiline Text Input
<select>...</select>Drop down list
<option>...</option>An option in a dropdown list
<optgroup>...</optgroup>Groups related options in dropdown list
<fieldset>...</fieldset>Groups related elements in a form
<legend>...</legend>Caption for <fieldset> element
<datalist>...</datalist>List of options
<output>...</output>Result

HTML Frames, Audio, Video & Others

Element / PropertyDescription
<iframe>...</iframe>Inline Frame
<audio>...</audio>Audio
<video>...</video>Video
<source />Resources for <audio>, <video> and <picture> elements
<track />Text track for <audio> and <video> elements
<embed />Container for external applications
<object>...</object>Embedded Object
<param />Parameter for <object>

HTML Layouts

Element / PropertyDescription
<div>...</div>Division / Section / Block Container for HTML elements
<span>...</span>Inline container for HTML elements
<header>...</header>Header content of a document
<main>...</main>Main content of a document
<footer>...</footer>Footer content of a document
<nav>...</nav>Navigation Links
<section>...</section>Section in a document
<article>...</article>Article in a document
<aside>...</aside>Side content in a document
<details>...</details>Additional details that user can hide or view on demand
<summary>...</summary>Heading for <details> element
<dialog>...</dialog>Dialog Box

CSS Cheat Sheet

CSS Introduction

Element / PropertyDescription
CSSStyles used for Cascading Style Sheets; CSS is used to style HTML pages and control presentation.

CSS Syntax

Element / PropertyDescription
Selector { property: value; }A CSS rule consists of a selector and one or more declarations.

CSS Insertion

Element / PropertyDescription
External CSSUsing a <link> element to connect an external stylesheet.
Internal CSSUsing a <style> element inside the HTML document.
Inline CSSDefining CSS directly using the style attribute of an HTML element.

CSS Comments

Element / PropertyDescription
/* Single Line Comment */CSS comments are written between /* and */ and are ignored by the browser.

CSS Margins

Element / PropertyDescription
marginSets the margin on all sides.
margin-top / margin-bottom / margin-right / margin-leftSets the margin for an individual side.

CSS Padding

Element / PropertyDescription
paddingSets padding on all sides.
padding-top / padding-bottom / padding-right / padding-leftSets padding for an individual side.

CSS Visibility

Element / PropertyDescription
visibilityControls whether an element is visible: visible, hidden, collapse, or inherit.
displayControls whether and how an element is displayed, such as inline, block, grid, flex, none, etc.

CSS Outline

Element / PropertyDescription
outline-styleControls outline style such as dotted, dashed, solid, double, groove, ridge, inset, outset, none, inherit.
outline-colorSets outline color.
outline-widthSets outline width.
outline-offsetSets the space between outline and border.
outlineShorthand for outline style, width and color.

CSS Table

Element / PropertyDescription
table-layoutControls table layout: auto, fixed, initial, inherit.
caption-sideControls caption position: top, bottom, initial, inherit.
empty-cellsControls display of empty cells: show, hide, initial, inherit.
border-spacingControls spacing between table cells.
border-collapseControls whether table borders are collapsed or separated.

CSS Text

Element / PropertyDescription
colorSets text color.
font-familySets font family.
font-sizeSets font size.
font-stylenormal, italic, oblique, inherit.
font-variantnormal, small-caps, inherit.
font-weightnormal, bold, bolder, lighter or numeric weights.
fontShorthand for font properties.
text-alignleft, right, center, justify, initial, inherit.
vertical-alignbaseline, length, sub, super, top, middle, bottom, etc.
text-align-lastControls alignment of the last line.
directionControls text direction: ltr or rtl.
text-decoration-lineunderline, overline, line-through, blink, none.
text-decoration-stylesolid, double, dotted, dashed, wavy, initial, inherit.
text-decoration-colorSets decoration color.
text-decoration-thicknessControls decoration thickness.
text-decorationShorthand for text decoration.
text-transformnone, capitalize, uppercase, lowercase, initial, inherit.
text-indentSets indentation of the first line.
line-heightSets line height.
letter-spacingControls spacing between letters.
word-spacingControls spacing between words.
white-spacenormal, nowrap, pre, pre-line, pre-wrap, initial, inherit.
text-shadowAdds shadow to text.
word-breaknormal, break-all, keep-all, break-word.
word-wrapnormal, break-word.
writing-modehorizontal-tb, vertical-rl, vertical-lr.
text-overflowclip, ellipsis, initial, inherit.
text-justifyauto, inter-word, inter-character, none, initial, inherit.

CSS Selectors

Element / PropertyDescription
Name Selectorp { }
ID Selector#id { }
Class Selector.class { }
Universal Selector* { }
Group Selectorp, div, span { }
Descendant Selectordiv p { }
Child Selectordiv > p { }
Adjacent Sibling Selectordiv + p { }
General Sibling Selectordiv ~ p { }
Pseudo Class Selector:hover, :focus, :checked, :visited, :enabled, :disabled, :first-child, :last-child, :only-child, :nth-child(), :first-of-type, :last-of-type, :nth-of-type(), etc.

CSS Background

Element / PropertyDescription
background-colorSets background color or transparent.
background-imageSpecifies one or more background images.
background-repeatrepeat, repeat-x, repeat-y, no-repeat, initial, inherit.
background-positionControls image position: left/right/top/bottom/center or percentages/lengths.
background-sizeauto, cover, contain, length, percentage.
background-attachmentscroll, fixed, local, initial, inherit.
background-clipborder-box, padding-box, content-box, initial, inherit.
background-originpadding-box, border-box, content-box.
background-blend-modeControls blending mode of background layers.
backgroundShorthand background property.

CSS Borders

Element / PropertyDescription
borderSets border width, style and color.
border-top / right / bottom / leftControls a particular border side.
border-styledotted, dashed, solid, double, groove, ridge, inset, outset, none, hidden.
border-widththin, medium, thick or length.
border-colorSets border color.
border-radiusRounds corners.
border-top-left-radius / ...Controls individual corner radii.
border-imageUses an image as a border.
border-image-sourceSpecifies border image source.
border-image-sliceSpecifies how the border image is sliced.
border-image-widthSpecifies border image width.
border-image-outsetSpecifies distance border image extends beyond border.
border-image-repeatrepeat, stretch, round, space.

CSS Dimensions

Element / PropertyDescription
height / widthauto, length, %, initial, inherit.
max-height / max-widthnone, length, %, initial, inherit.
min-height / min-widthlength, %, initial, inherit.

CSS Lists

Element / PropertyDescription
list-style-typedisc, circle, square, decimal, decimal-leading-zero, lower-roman, upper-roman, lower-alpha, upper-alpha, lower-greek, lower-latin, upper-latin, etc.
list-style-imageSpecifies an image as the list marker.
list-style-positioninside, outside, initial, inherit.
list-styleShorthand for list properties.

CSS Positions

Element / PropertyDescription
positionstatic, absolute, fixed, relative, sticky, initial, inherit.
top / bottom / left / rightOffset positioned elements.
floatnone, left, right, initial, inherit.
clearnone, left, right, both, initial, inherit.
clipauto, shape, initial, inherit.
z-indexControls stacking order.

CSS Shadow

Element / PropertyDescription
box-shadowAdds one or more shadows around a box.
text-shadowAdds shadow around text.

CSS Overflow

Element / PropertyDescription
overflowvisible, hidden, scroll, auto, initial, inherit.
overflow-x / overflow-yControls overflow in the horizontal or vertical direction.
overflow-wrapControls whether long words can be broken.

CSS Columns

Element / PropertyDescription
column-countNumber of columns.
column-gapGap between columns.
column-widthWidth of columns.
column-spanWhether an element spans all columns.
column-fillauto, balance, initial, inherit.
column-rule-stylenone, hidden, dotted, dashed, solid, double, groove, ridge, inset, outset.
column-rule-colorSets column rule color.
column-rule-widthSets column rule width.
column-ruleShorthand for column rule.
columnsShorthand for column-width and column-count.

CSS Transition

Element / PropertyDescription
transition-propertynone, all, initial, inherit or selected property.
transition-durationTime in seconds or milliseconds.
transition-delayDelay before transition starts.
transition-timing-functionlinear, ease, ease-in, ease-out, ease-in-out, cubic-bezier(), steps(), etc.
transitionShorthand transition property.

CSS 2D / 3D

Element / PropertyDescription
transformnone or transform functions such as translate, rotate, scale, skew, matrix, perspective.
transform-originSets the origin for transforms.
transform-styleflat or preserve-3d.
perspectiveSets perspective for 3D transforms.
perspective-originSets the perspective origin.
backface-visibilityControls visibility of the back face.

CSS Animation

Element / PropertyDescription
animation-nameSpecifies the @keyframes name.
animation-durationSpecifies animation duration.
animation-delaySpecifies animation delay.
animation-directionnormal, reverse, alternate, alternate-reverse.
animation-iteration-countNumber of times animation runs; infinite for unlimited.
animation-play-statepaused, running.
animation-fill-modenone, forwards, backwards, both.
animation-timing-functionTiming function used by the animation.
animationShorthand for animation properties.

CSS Flexible

Element / PropertyDescription
orderControls visual order of flex items.
flex-basisInitial main size of a flex item.
flex-growControls how much an item grows.
flex-shrinkControls how much an item shrinks.
flexShorthand for flex-grow, flex-shrink and flex-basis.
align-contentControls cross-axis alignment of flex lines.
align-itemsControls alignment of flex items.
align-selfOverrides align-items for a particular item.
justify-contentControls distribution along the main axis.

CSS Grids

Element / PropertyDescription
gridShorthand grid property.
grid-template-columns / rowsDefines columns and rows.
grid-template-areasDefines named grid areas.
grid-templateShorthand for grid template properties.
grid-column / grid-rowControls grid item placement.
grid-column-start / endDefines grid column start/end lines.
grid-row-start / endDefines grid row start/end lines.
grid-gap / row-gap / column-gapControls gaps between grid tracks.
grid-areaAssigns an item to a named grid area.
grid-auto-columns / rows / flowControls automatically created grid tracks and placement.
justify-items / align-items / place-itemsControls alignment of grid items.
justify-content / align-content / place-contentControls grid alignment inside the container.

CSS Miscellaneous

Element / PropertyDescription
allResets or controls all properties: initial, inherit, unset.
box-sizingcontent-box or border-box.
break-after / break-before / break-insideControls page/column/region breaking.
image-renderingauto, smooth, high-quality, pixelated, crisp-edges.
object-fitfill, contain, cover, none, scale-down.
object-positionControls position of replaced content.
opacitySets opacity.
resizenone, both, horizontal, vertical, initial, inherit.
tab-sizeControls tab width.
user-selectControls whether text can be selected.

Original HTML Cheat Sheet

Original HTML Cheat Sheet

Original CSS Cheat Sheet

Original CSS Cheat Sheet