{"id":7,"date":"2009-12-08T10:16:22","date_gmt":"2009-12-08T09:16:22","guid":{"rendered":"http:\/\/goranmitev.ispraznise.com\/?p=7"},"modified":"2010-07-08T10:22:12","modified_gmt":"2010-07-08T08:22:12","slug":"css-shorthands","status":"publish","type":"post","link":"https:\/\/goranmitev.com\/blog\/css-shorthands","title":{"rendered":"CSS shorthands"},"content":{"rendered":"<p>There is no official documentation about CSS shorthands but they are there and some of you know them, some of you not.   I tried to make a list of CSS shorthands, that may be of use by anyone.<\/p>\n<p><!--more--><\/p>\n<h3>background<\/h3>\n<h4>A typical shorthand:<\/h4>\n<pre>background: #FFFFFF url(image.jpg) no-repeat scroll top left;<\/pre>\n<h4>Available background properties:<\/h4>\n<ul>\n<li> background-color\n<ul>\n<li>transparent<\/li>\n<li>hexadecimal from #000000 to #FFFFFF<\/li>\n<li> predefined colors like: blue, red, green, etc. (with letters)<\/li>\n<li>rgb(X,X,X)  where X is a number from 0 to 255<\/li>\n<\/ul>\n<\/li>\n<li> background-image\n<ul>\n<li>none<\/li>\n<li>url(URI)  where URI can be relative or absolute path to your image<\/li>\n<\/ul>\n<\/li>\n<li> background-repeat\n<ul>\n<li>no-repeat<\/li>\n<li>repeat-x<\/li>\n<li>repeat-y<\/li>\n<li>repeat (includes both: repeat-x and repeat-y)<\/li>\n<\/ul>\n<\/li>\n<li> background-attachment\n<ul>\n<li>scroll<\/li>\n<li>fixed<\/li>\n<\/ul>\n<\/li>\n<li> background-position\n<ul>\n<li>top left<\/li>\n<li>top right<\/li>\n<li>top center<\/li>\n<li>bottom left<\/li>\n<li>bottom right<\/li>\n<li>bottom center<\/li>\n<li>center left<\/li>\n<li>center right<\/li>\n<li>center center<\/li>\n<li>0 0<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h4>Defaults to:<\/h4>\n<pre>background: transparent none no-repeat scroll 0 0;<\/pre>\n<p>That means if you left out any of the properties, the others will have these values.<\/p>\n<h3>font<\/h3>\n<h4>A typical shorthand:<\/h4>\n<pre>font: normal normal bold 1em\/1.2em georgia,\"times new roman\",serif;<\/pre>\n<h4>Available font properties:<\/h4>\n<ul>\n<li> font-style\n<ul>\n<li>normal<\/li>\n<li>italic<\/li>\n<li> inherit<\/li>\n<li>oblique<\/li>\n<\/ul>\n<\/li>\n<li> font-variant\n<ul>\n<li>inherit<\/li>\n<li>normal<\/li>\n<li>small-caps<\/li>\n<\/ul>\n<\/li>\n<li> font-weight\n<ul>\n<li>normal<\/li>\n<li>bold<\/li>\n<li>bolder<\/li>\n<li>lighter<\/li>\n<li>inherit<\/li>\n<\/ul>\n<\/li>\n<li>font-size\n<ul>\n<li>xx-small<\/li>\n<li>x-small<\/li>\n<li>small<\/li>\n<li>medium<\/li>\n<li>large<\/li>\n<li>larger<\/li>\n<li>x-large<\/li>\n<li>xx-large<\/li>\n<li>number+unit<\/li>\n<\/ul>\n<\/li>\n<li>line-height\n<ul>\n<li>normal<\/li>\n<li>number+unit<\/li>\n<\/ul>\n<\/li>\n<li>font-family\n<ul>\n<li>(list of fonts)<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>margin and padding<\/h3>\n<p>The margin and the padding are the easiest and the rules go clockwise:<\/p>\n<p>margin: (top) (right) (bottom) (left);<\/p>\n<h4 style=\"font-size: 1.17em;\">A typical shorthands (examples):<\/h4>\n<p>This adds 10px margin on all sides of the element:<\/p>\n<pre>margin: 10px 10px 10px 10px;<\/pre>\n<p>This also, adds 10px margin on all sides of the element<\/p>\n<pre>margin: 10px;<\/pre>\n<p>This adds 10px margin to top and bottom and a 20px margin to left and right:<\/p>\n<pre>margin: 10px 20px;<\/pre>\n<p>Also any combination of number and measurement unit is possible.<\/p>\n<p>The same rules apply for padding as well.<\/p>\n<h3>border<\/h3>\n<h4 style=\"font-size: 1.17em;\">A typical shorthand:<\/h4>\n<pre>border: 1px solid blue;<\/pre>\n<h4 style=\"font-size: 1.17em;\">Available border properties:<\/h4>\n<ul>\n<li>border-width: number+unit;<\/li>\n<li>border-style:\n<ul>\n<li>solid;<\/li>\n<li>dotted;<\/li>\n<li>dashed;<\/li>\n<li>hidden<\/li>\n<li>none<\/li>\n<li>double<\/li>\n<li>groove etc.<\/li>\n<\/ul>\n<\/li>\n<li>border-color:\n<ul>\n<li>none<\/li>\n<li>hexadecimal from #000000 to #FFFFFF<\/li>\n<li>predefined colors like: blue, red, green, etc. (with letters)<\/li>\n<li>rgb(X,X,X)  where X is a number from 0 to 255<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>list-style<\/h3>\n<h4 style=\"font-size: 1.17em;\">A typical shorthand:<\/h4>\n<pre style=\"font: normal normal normal 12px\/18px Consolas, Monaco, 'Courier New', Courier, monospace;\">list-style: disc outside url(image.gif);<\/pre>\n<h4 style=\"font-size: 1.17em;\">Available list-style properties:<\/h4>\n<ul>\n<li>list-style-type\n<ul>\n<li>disc<\/li>\n<li>square<\/li>\n<li>circle<\/li>\n<li>decimal<\/li>\n<li>georgian<\/li>\n<li>etc<\/li>\n<\/ul>\n<\/li>\n<li>list-style-position\n<ul>\n<li>inside<\/li>\n<li>outside<\/li>\n<\/ul>\n<\/li>\n<li>list-style-image:\n<ul>\n<li>none<\/li>\n<li>url<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h4 style=\"font-size: 1.17em;\">Defaults to:<\/h4>\n<pre style=\"font: normal normal normal 12px\/18px Consolas, Monaco, 'Courier New', Courier, monospace;\">list-style: disc outside none;<\/pre>\n<p>There are other shorthand out there, but are less used. Any comments are welcome.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There is no official documentation about CSS shorthands but they are there and some of you know them, some of you not. I tried to make a list of CSS shorthands, that may be of use by anyone.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,4],"tags":[],"_links":{"self":[{"href":"https:\/\/goranmitev.com\/blog\/wp-json\/wp\/v2\/posts\/7"}],"collection":[{"href":"https:\/\/goranmitev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/goranmitev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/goranmitev.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/goranmitev.com\/blog\/wp-json\/wp\/v2\/comments?post=7"}],"version-history":[{"count":6,"href":"https:\/\/goranmitev.com\/blog\/wp-json\/wp\/v2\/posts\/7\/revisions"}],"predecessor-version":[{"id":24,"href":"https:\/\/goranmitev.com\/blog\/wp-json\/wp\/v2\/posts\/7\/revisions\/24"}],"wp:attachment":[{"href":"https:\/\/goranmitev.com\/blog\/wp-json\/wp\/v2\/media?parent=7"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/goranmitev.com\/blog\/wp-json\/wp\/v2\/categories?post=7"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/goranmitev.com\/blog\/wp-json\/wp\/v2\/tags?post=7"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}