:

Colon

Unicode
U+003A
Category
Punctuation
HTML Entity
:
CSS
\003A
The colon (:) announces what follows: a list, an explanation, a quotation or an example. It also separates hours from minutes (10:30), the parts of a ratio (3:1) and chapter from verse in Bible references (John 3:16). Turned sideways it is the pair of eyes in the classic smileys :) and :-(. Mathematics has a separate, vertically centred ratio sign ∶ (U+2236), but in everyday text the keyboard colon does the job.

On US and UK keyboards the colon is Shift + the semicolon key, right of L. On iPhone it is on the 123 page; on Android, on the ?123 page.

How to Type

Windows
Shift+; · Alt+58
macOS
Shift+;
Linux
Shift+; · Ctrl+Shift+U 3a
HTML
:

In Programming

In Python a colon ends the header of every block (if, for, def, class) and builds slices (a[1:3]) and dict literals; in JavaScript and JSON it separates key from value. C-family languages use it in the ternary operator (a ? b : c), C++ and PHP use :: for scope resolution, and CSS writes pseudo-classes with it (:hover) and pseudo-elements with two (::before). URLs put it after the scheme (https:) and before the port (:8080); Windows drive letters end in it (C:).

Tags

colon colon symbol two dots shift semicolon alt 58 time separator keyboard symbol punctuation ascii

Related Symbols