Skip to content

Instantly share code, notes, and snippets.

@RebeccaWhit3
Last active April 2, 2017 21:35
Show Gist options
  • Save RebeccaWhit3/6f632eab831db1d7bdba351f49d2ec4c to your computer and use it in GitHub Desktop.
Save RebeccaWhit3/6f632eab831db1d7bdba351f49d2ec4c to your computer and use it in GitHub Desktop.
CSS Properties for Text | A Complete List

CSS Content Property

About

Valid property values for 'style { content: ; }'.

CSS content property lists

MDN

  • [ , ]* [ normal | none | ] [/ ]?
  • where
  • = | <image()> | <image-set()> | <element()> | <cross-fade()> |
  • = [ | contents | | | | <leader()> ]+
  • where
  • <image()> = image( [ [ | ]? , ? ]! )
  • <image-set()> = image-set( # )
  • <element()> = element( )
  • <cross-fade()> = cross-fade( , ? )
  • = <linear-gradient()> | <repeating-linear-gradient()> | <radial-gradient()> | <repeating-radial-gradient()>
  • = open-quote | close-quote | no-open-quote | no-close-quote
  • = <target-counter()> | <target-counters()> | <target-text()>
  • <leader()> = leader( dotted | solid | space | )
  • where
  • = <rgb()> | <rgba()> | <hsl()> | <hsla()> | | | currentcolor |
  • = [ | ]
  • = ? &&
  • = |
  • <linear-gradient()> = linear-gradient( [ | to ]? , )
  • <repeating-linear-gradient()> = repeating-linear-gradient( [ | to ]? , )
  • <radial-gradient()> = radial-gradient( [ || ]? [ at ]? , )
  • <repeating-radial-gradient()> = repeating-radial-gradient( [ || ]? [ at ]? , )
  • <target-counter()> = target-counter( [ | ] , [, ]? )
  • <target-counters()> = target-counters( [ | ] , , [, ]? )
  • <target-text()> = target-text( [ | ] [, [ content | before | after | first-letter ] ]? )
  • where
  • <rgb()> = rgb( #{3} , ? )
  • <rgba()> = rgba( #{3} , )
  • <hsl()> = hsl( , , , ? )
  • <hsla()> = hsla( , , , )
  • = transparent | aliceblue | antiquewhite | aqua | aquamarine | azure | beige | bisque | black | blanchedalmond | blue | blueviolet | brown | burlywood | cadetblue | chartreuse | chocolate | coral | cornflowerblue | cornsilk | crimson | cyan | darkblue | darkcyan | darkgoldenrod | darkgray | darkgreen | darkgrey | darkkhaki | darkmagenta | darkolivegreen | darkorange | darkorchid | darkred | darksalmon | darkseagreen | darkslateblue | darkslategray | darkslategrey | darkturquoise | darkviolet | deeppink | deepskyblue | dimgray | dimgrey | dodgerblue | firebrick | floralwhite | forestgreen | fuchsia | gainsboro | ghostwhite | gold | goldenrod | gray | green | greenyellow | grey | honeydew | hotpink | indianred | indigo | ivory | khaki | lavender | lavenderblush | lawngreen | lemonchiffon | lightblue | lightcoral | lightcyan | lightgoldenrodyellow | lightgray | lightgreen | lightgrey | lightpink | lightsalmon | lightseagreen | lightskyblue | lightslategray | lightslategrey | lightsteelblue | lightyellow | lime | limegreen | linen | magenta | maroon | mediumaquamarine | mediumblue | mediumorchid | mediumpurple | mediumseagreen | mediumslateblue | mediumspringgreen | mediumturquoise | mediumvioletred | midnightblue | mintcream | mistyrose | moccasin | navajowhite | navy | oldlace | olive | olivedrab | orange | orangered | orchid | palegoldenrod | palegreen | paleturquoise | palevioletred | papayawhip | peachpuff | peru | pink | plum | powderblue | purple | rebeccapurple | red | rosybrown | royalblue | saddlebrown | salmon | sandybrown | seagreen | seashell | sienna | silver | skyblue | slateblue | slategray | slategrey | snow | springgreen | steelblue | tan | teal | thistle | tomato | turquoise | violet | wheat | white | whitesmoke | yellow | yellowgreen
  • = ActiveBorder | ActiveCaption | AppWorkspace | Background | ButtonFace | ButtonHighlight | ButtonShadow | ButtonText | CaptionText | GrayText | Highlight | HighlightText | InactiveBorder | InactiveCaption | InactiveCaptionText | InfoBackground | InfoText | Menu | MenuText | Scrollbar | ThreeDDarkShadow | ThreeDFace | ThreeDHighlight | ThreeDLightShadow | ThreeDShadow | Window | WindowFrame | WindowText
  • = [ left | right ] || [ top | bottom ]
  • = {2,}
  • = circle | ellipse
  • = closest-side | farthest-side | closest-corner | farthest-corner | | {2}
  • = [[ left | center | right | top | bottom | ] | [ left | center | right | ] [ top | center | bottom | ] | [ center | [ left | right ] ? ] && [ center | [ top | bottom ] ? ]]
  • = | symbols()
  • where
  • = |
  • = , |
  • = |
  • = ?
  • = |
  • =

W3

s s
normal Default value. Sets the content, if specified, to normal, which default is "none" (which is nothing)
style {
  content: normal;
}

Sets the content, if specified, to nothing

none

Sets the content to the text you specify

string

Sets the content as a counter

counter

Sets the content as one of the selector's attribute

attr(attribute)

Sets the content to be an opening quote

open-quote

Sets the content to be a closing quote

close-quote

Removes the opening quote from the content, if specified

no-open-quote

Removes the closing quote from the content, if specified

no-close-quote

Sets the content to be some kind of media (an image, a sound, a video, etc.)

url(url)

Sets this property to its default value.

initial

Inherits this property from its parent element.

inherit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment