MDN self-hosted library · e01.org

Shorthand properties

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

css
p {
  background-color: red;
  background: url("images/bg.gif") no-repeat left top;
}
css
background-color: black;
background-image: url("images/bg.gif");
background-repeat: no-repeat;
background-position: left top;
css
background: black url("images/bg.gif") no-repeat left top;
css
font-style: italic;
font-weight: bold;
font-size: 0.8em;
line-height: 1.2;
font-family: "Arial", sans-serif;
css
font:
  italic bold 0.8em/1.2 "Arial",
  sans-serif;
css
border-width: 1px;
border-style: solid;
border-color: black;
css
border: 1px solid black;
css
margin-top: 10px;
margin-right: 5px;
margin-bottom: 10px;
margin-left: 5px;
css
margin: 10px 5px 10px 5px;
css
top: 0;
right: 20px;
bottom: 0;
left: 20px;
css
inset: 0 20px 0 20px;