CSS Reference

CSS Selectors
SL N 1 2 3 4 5 6 7 8 9 .class #id * [attribute] [attribute=value] [attribute~=value] [attribute| =language] element element,element Selector Example .intro #firstname * [target] Example Selects All elements with class="intro" The element with id="firstname" All elements All elements with a target attribute CS S 1 1 2 2 2 2 2 1 1 1 2 2 1 2 2 2 1 1 2 1 2 1 1

[target=_blank All elements with a target attribute equal to "_blank" ] [title=flower] [lang|=en] p div,p div p div>p div+p a:active p:after p:before p:first-child p:first-letter p:first-line input:focus a:hover p:lang(it) a:link a:visited All elements with a title attribute that contains space separated words, one of which is "flower" All elements where the lang attribute's value is "en", even if the value contains a hyphen (-), like "en-us" All <p> elements All <div> elements and all <p> elements All <p> elements inside <div> elements All <p> elements where the parent is a <div> element All <p> elements placed immediately after a <div> element Active links Content will be placed after each <p> element Content will be placed before each <p> element All <p> elements that is the first child of its parent The first letter of all <p> elements The first line of all <p> elements The input element that has focus Links on mouse over All <p> elements with the lang attribute containing "it" All links (<a> elements with href) All visited links

10 element element 11 element>element 12 element+element 13 :active 14 :after 15 :before 16 :first-child 17 :first-letter 18 :first-line 19 :focus 20 :hover 21 :lang(language) 22 :link 23 :visited

CSS Properties
SLN 1 2 3 4 5 6 7 8 9 Property background background-attachment background-color background-image background-position background-repeat border border-bottom border-bottom-color Description Sets all the background properties in one declaration Sets whether a background image is fixed or scrolls with the rest of the page Sets the background color of an element Sets the background image for an element Sets the starting position of a background image Sets how a background image will be repeated Sets all the border properties in one declaration Sets all the bottom border properties in one declaration Sets the color of the bottom border Sets the style of the bottom border Sets the width of the bottom border Sets the color of the four borders Specifies whether or not table borders should be collapsed Sets all the left border properties in one declaration Sets the color of the left border Sets the style of the left border Sets the width of the left border Sets all the right border properties in one declaration Sets the color of the right border Sets the style of the right border Sets the width of the right border Specifies the distance between the borders of adjacent cells Sets the style of the four borders Sets all the top border properties in one declaration Sets the color of the top border Sets the style of the top border Sets the width of the top border Sets the width of the four borders Sets the bottom margin edge for a positioned box Specifies the placement of a table caption Specifies which sides of an element where other floating elements are not allowed Clips an absolutely positioned element Sets the color of text Used with the :before and :after pseudo-elements, to insert generated content Increments one or more counters Creates or resets one or more counters Specifies the type of cursor to be displayed Specifies the text direction/writing direction Specifies the type of box an element should generate CSS 1 1 1 1 1 1 1 1 2 2 1 1 2 1 2 2 1 1 2 2 1 2 1 1 2 2 1 1 2 2 1 2 1 2 2 2 2 2 1

10 border-bottom-style 11 border-bottom-width 12 border-color 13 border-collapse 14 border-left 15 border-left-color 16 border-left-style 17 border-left-width 18 border-right 19 border-right-color 20 border-right-style 21 border-right-width 22 border-spacing 23 border-style 24 border-top 25 border-top-color 26 border-top-style 27 border-top-width 28 border-width 29 bottom 30 caption-side 31 clear 32 clip 33 color 34 content 35 counter-increment 36 counter-reset 37 cursor 38 direction 39 display

40 empty-cells 41 float 42 font 43 font-family 44 font-size 45 font-style 46 font-variant 47 font-weight 48 height 49 left 50 letter-spacing 51 line-height 52 list-style 53 list-style-image 54 list-style-position 55 list-style-type 56 margin 57 margin-bottom 58 margin-left 59 margin-right 60 margin-top 61 max-height 62 max-width 63 min-height 64 min-width 65 orphans 66 outline 67 outline-color 68 outline-style 69 outline-width 70 overflow 71 padding 72 padding-bottom 73 padding-left 74 padding-right 75 padding-top 76 page-break-after 77 page-break-before 78 page-break-inside 79 position

Specifies whether or not to display borders and background on empty cells in a table Specifies whether or not a box should float Sets all the font properties in one declaration Specifies the font family for text Specifies the font size of text Specifies the font style for text Specifies whether or not a text should be displayed in a small-caps font Specifies the weight of a font Sets the height of an element Sets the left margin edge for a positioned box Increase or decrease the space between characters in a text Sets the line height Sets all the properties for a list in one declaration Specifies an image as the list-item marker Specifies if the list-item markers should appear inside or outside the content flow Specifies the type of list-item marker Sets all the margin properties in one declaration Sets the bottom margin of an element Sets the left margin of an element Sets the right margin of an element Sets the top margin of an element Sets the maximum height of an element Sets the maximum width of an element Sets the minimum height of an element Sets the minimum width of an element Sets the minimum number of lines that must be left at the bottom of a page when a page break occurs inside an element Sets all the outline properties in one declaration Sets the color of an outline Sets the style of an outline Sets the width of an outline Specifies what happens if content overflows an element's box Sets all the padding properties in one declaration Sets the bottom padding of an element Sets the left padding of an element Sets the right padding of an element Sets the top padding of an element Sets the page-breaking behavior after an element Sets the page-breaking behavior before an element Sets the page-breaking behavior inside an element Specifies the type of positioning for an element

2 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 2 2 2 2

80 quotes 81 right 82 table-layout 83 text-align 84 text-decoration 85 text-indent 86 text-shadow 87 text-transform 88 top 89 unicode-bidi 90 vertical-align 91 visibility 92 white-space 93 widows 94 width 95 Word-spacing 96 z-index

Sets the type of quotation marks for embedded quotations Sets the right margin edge for a positioned box Sets the layout algorithm to be used for a table Specifies the horizontal alignment of text Specifies the decoration added to text Specifies the indentation of the first line in a text-block Specifies the shadow effect added to text Controls the capitalization of text Sets the top margin edge for a positioned box Sets the vertical alignment of an element Specifies whether or not an element is visible Specifies how white-space inside an element is handled Sets the minimum number of lines that must be left at the top of a page when a page break occurs inside an element Sets the width of an element Increases or decreases the space between words in a text Sets the stack order of an element

2 2 2 1 1 1 2 1 2 2 1 2 1 2 1 1 2

Sign up to vote on this title
UsefulNot useful