On Github R1ZZU / html-css-basics-part-2
font: [font-style||font-variant||font-weight]
font-size
[/line-height]
font-family |
inherit
.some-class {
font: italic small-caps bold 14px/12px Arial, Helvetica, sans-serif;
}
eqauls to
.some-class {
font-style: italic;
font-variant: small-caps;
font-weight: bold;
font-size: 14px;
line-height: 12px;
font-family: Arial, Helvetica, sans-serif;
}
.some-class {
margin: 0px 0px 0px 0px;
}
eqauls to
.some-class {
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
margin-left: 0px;
}
eqauls to
.some-class {
margin: 0;
}
.some-class {
margin: 10px 15px;
}
eqauls to
.some-class {
margin-top: 10px;
margin-bottom: 10px;
margin-right: 15px;
margin-left: 15px;
}
.some-class {
margin: 10px 15px 20px;
}
eqauls to
.some-class {
margin-top: 10px;
margin-right: 15px;
margin-bottom: 20px;
margin-left: 15px;
}
Same rules for padding
.some-class {
box-sizing: border-box;
}
div {
property: value;
}
applied to all 'divs'
#mySuperID {
property: value;
}
applied to element with id = "#mySuperID"
.my-awesome-class {
property: value;
}
applied to ALL elements with class = "my-awesome-class"
div.super-class {
property: value;
}
applied to ALL 'divs' with class = "my-awesome-class"
parent-selector child-selector {
property: value;
}
applied to all elements satisfying 2 condition:
parent-selector > child-selector {
property: value;
}
applied to all elements satisfying 2 condition:
selector1 + selector2 {
property: value;
}
first sibling selector
selector1 ~ selector2 {
property: value;
}
sibling selector
selector[attrName] {
property: value;
}
applied to all elements which have 'attrName' attribute
selector[attrName="attrValue"] {
property: value;
}
applied to all elements which have 'attrName' attribute with value = "attrValue"
selector[attrName^="someString"] {
property: value;
}
applied to all elements which:
selector[attrName*="partOfValue"] {
property: value;
}
applied to all elements which:
selector[attrName$="endsWith"] {
property: value;
}
applied to all elements which:
State pseudo classes