Skip to content

Instantly share code, notes, and snippets.

@carlos-sanchez
Created November 14, 2013 04:13
Show Gist options
  • Save carlos-sanchez/7461231 to your computer and use it in GitHub Desktop.
Save carlos-sanchez/7461231 to your computer and use it in GitHub Desktop.
CSS Shorthand Rules
font: bold italic small-caps 1em/1.5em verdana,sans-serif
background: [background-color] [background-image] [background-repeat]
[background-attachment] [background-position] / [ background-size]
[background-origin] [background-clip];
Notice the forward slash, similar to how font shorthand and border-radius can be written. The slash allows you to include a background-size value after the position in supporting browsers.
In addition, you also have up to two optional declarations for background-origin and background-clip.
.example {
background: aquamarine url(img.png)
no-repeat
scroll
center center / 50%
content-box content-box;
}
Only on firefox:
text-decoration: text-decoration-line, text-decoration-color, text-decoration-style
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment