adv

css

CSS Selectors

In CSS, selectors are patterns used to select the element(s) you want to style.
The "CSS" column indicates in which CSS version the property is defined (CSS1 or CSS2).


SelectorExampleExample Selects:CSS
.class.introAll elements with class="intro"1
#id#firstnameThe element with id="firstname"1
**All elements2
elementpAll <p> elements1
element,elementdiv,pAll <div> elements and all <p> elements1
element elementdiv pAll <p> elements inside <div> elements1
element>elementdiv>pAll <p> elements where the parent is a <div> element2
element+elementdiv+pAll <p> elements placed immediately after a <div> element2
[attribute][target]All elements with a target attribute2
[attribute=value][target=_blank]All elements with a target attribute equal to "_blank"2
[attribute~=value][title=flower]All elements with a title attribute that contains space separated words, one of which is "flower"2
[attribute|=language][lang|=en]All elements where the lang attribute's value is "en", even if the value contains a hyphen (-), like "en-us"2
:linka:linkAll links (<a> elements with href)1
:visiteda:visitedAll visited links1
:activea:activeActive links1
:hovera:hoverLinks on mouse over1
:focusinput:focusThe input element that has focus2
:first-letterp:first-letterThe first letter of all <p> elements1
:first-linep:first-lineThe first line of all <p> elements1
:first-childp:first-childAll <p> elements that is the first child of its parent2
:beforep:beforeContent will be placed before each <p> element2
:afterp:afterContent will be placed after each <p> element2
:lang(language)p:lang(it)All <p> elements with the lang attribute containing "it"2



CSS Properties

CSS Property Groups

The "CSS" column indicates in which CSS version the property is defined (CSS1 or CSS2).

Background Properties

PropertyDescriptionCSS
backgroundSets all the background properties in one declaration1
background-attachmentSets whether a background image is fixed or scrolls with the rest of the page1
background-colorSets the background color of an element1
background-imageSets the background image for an element1
background-positionSets the starting position of a background image1
background-repeatSets how a background image will be repeated1

Border and Outline Properties

PropertyDescriptionCSS
borderSets all the border properties in one declaration1
border-bottomSets all the bottom border properties in one declaration1
border-bottom-colorSets the color of the bottom border
border-bottom-styleSets the style of the bottom border1
border-bottom-widthSets the width of the bottom border1
border-colorSets the color of the four borders1
border-leftSets all the left border properties in one declaration1
border-left-colorSets the color of the left border1
border-left-styleSets the style of the left border1
border-left-widthSets the width of the left border1
border-rightSets all the right border properties in one declaration1
border-right-colorSets the color of the right border1
border-right-styleSets the style of the right border1
border-right-widthSets the width of the right border1
border-styleSets the style of the four borders1
border-topSets all the top border properties in one declaration1
border-top-colorSets the color of the top border1
border-top-styleSets the style of the top border1
border-top-widthSets the width of the top border1
border-widthSets the width of the four borders1
outlineSets all the outline properties in one declaration2
outline-colorSets the color of an outline2
outline-styleSets the style of an outline2
outline-widthSets the width of an outline2

Dimension Properties

PropertyDescriptionCSS
heightSets the height of an element1
max-heightSets the maximum height of an element2
max-widthSets the maximum width of an element2
min-heightSets the minimum height of an element2
min-widthSets the minimum width of an element2
widthSets the width of an element1

Font Properties

PropertyDescriptionCSS
fontSets all the font properties in one declaration1
font-familySpecifies the font family for text1
font-sizeSpecifies the font size of text1
font-styleSpecifies the font style for text1
font-variantSpecifies whether or not a text should be displayed in a small-caps font1
font-weightSpecifies the weight of a font1

Generated Content Properties

PropertyDescriptionCSS
contentUsed with the :before and :after pseudo-elements, to insert generated content2
counter-incrementIncrements one or more counters2
counter-resetCreates or resets one or more counters2
quotesSets the type of quotation marks for embedded quotations2

List Properties

PropertyDescriptionCSS
list-styleSets all the properties for a list in one declaration1
list-style-imageSpecifies an image as the list-item marker1
list-style-positionSpecifies if the list-item markers should appear inside or outside the content flow1
list-style-typeSpecifies the type of list-item marker1

Margin Properties

PropertyDescriptionCSS
marginSets all the margin properties in one declaration1
margin-bottomSets the bottom margin of an element1
margin-leftSets the left margin of an element1
margin-rightSets the right margin of an element1
margin-topSets the top margin of an element1

Padding Properties

PropertyDescriptionCSS
paddingSets all the padding properties in one declaration1
padding-bottomSets the bottom padding of an element1
padding-leftSets the left padding of an element1
padding-rightSets the right padding of an element1
padding-topSets the top padding of an element1

Positioning Properties

PropertyDescriptionCSS
bottomSets the bottom margin edge for a positioned box2
clearSpecifies which sides of an element where other floating elements are not allowed1
clipClips an absolutely positioned element2
cursorSpecifies the type of cursor to be displayed2
displaySpecifies the type of box an element should generate1
floatSpecifies whether or not a box should float1
leftSets the left margin edge for a positioned box2
overflowSpecifies what happens if content overflows an element's box2
positionSpecifies the type of positioning for an element2
rightSets the right margin edge for a positioned box2
topSets the top margin edge for a positioned box2
visibilitySpecifies whether or not an element is visible2
z-indexSets the stack order of an element2

Print Properties

PropertyDescriptionCSS
orphansSets the minimum number of lines that must be left at the bottom of a page when a page break occurs inside an element2
page-break-afterSets the page-breaking behavior after an element2
page-break-beforeSets the page-breaking behavior before an element2
page-break-insideSets the page-breaking behavior inside an element2
widowsSets the minimum number of lines that must be left at the top of a page when a page break occurs inside an element2

Table Properties

PropertyDescriptionCSS
border-collapseSpecifies whether or not table borders should be collapsed2
border-spacingSpecifies the distance between the borders of adjacent cells2
caption-sideSpecifies the placement of a table caption2
empty-cellsSpecifies whether or not to display borders and background on empty cells in a table2
table-layoutSets the layout algorithm to be used for a table2

Text Properties

PropertyDescriptionCSS
colorSets the color of text1
directionSpecifies the text direction/writing direction2
letter-spacingIncreases or decreases the space between characters in a text1
line-heightSets the line height1
text-alignSpecifies the horizontal alignment of text1
text-decorationSpecifies the decoration added to text1
text-indentSpecifies the indentation of the first line in a text-block1
text-shadowSpecifies the shadow effect added to text2
text-transformControls the capitalization of text1
unicode-bidi2
vertical-alignSets the vertical alignment of an element1
white-spaceSpecifies how white-space inside an element is handled1
word-spacingIncreases or decreases the space between words in a text1

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...
perPage: 1, numPages: 1, var firstText ='First'; var lastText ='Last'; var prevText ='« Previous'; var nextText ='Next »'; }