Your browserdoesn't support the features required by impress.js, so you are presented with a simplified version of this presentation.
For the best experience please use the latest Chrome, Safari or Firefox browser.
<selector1>, <selector2> {
<property1> : <value1>;
<property2> : <value2>;
<property3> : <value3>
}
<selector1> {
<property4> : <value4>
}
/* Css comment */
p, div {
background: red;
font-weight: bold;
color: blue
}
p {
font-style: italic
}
/* Css comment */
Selector | Selected element(s) |
---|---|
p | Paragraphs |
.class1 | Elements with class1 |
#content | Element with identifier content |
p.class1 | Paragaphs with class class1 |
p .class1 | Elements with class class1 having paragraph parent |
.class1 .class2 | Elements with class class2 having parent with class class1 |
p.class1.class2 | Paragraphs with both class1 and class2 classes |
Selector | Selected element(s) |
---|---|
* | All elements |
div > p | All <p> elements where the direct parent is a <div> element |
div + p | All <p> elements that are placed immediately after <div> elements |
p:first-child | Selects every <p> element that is the first child of its parent |
p:nth-child(2) | Selects every <p> element that is the second child of its parent |
<body>
<style>
body {
color: red;
font-size:20px;
border: 1px solid black;
}
</style>
<div>
<p>
<span>Sample text</span>
</p>
</div>
</body>
<body>
<style>
* {
border: inherit;
}
body {
color: red;
font-size:20px;
border: 1px solid black;
}
</style>
<div>
<p>
<span>Sample text</span>
</p>
</div>
</body>
Source | 2 - Inline 1 - <style></style> tag 0 - External file |
Ids | Number of identifiers in selector |
Classes | Number of classes in selector |
Elements | Number of elements in selector |
<div id="content">
<p class="active">
Text
<!-- (2,0,0,0) = 2000 -->
<span style="color: red">!</span>
</p>
</div>
/* (0,1,0,1) = 101 */
#content p {
color: blue
}
/* (0,0,1,2) = 12 */
div p.active {
color: yellow
}
<div>
<span>1</span>
<span>2</span><span>3</span>
</div>
<div>
<span>4</span>
<span>5</span><span>6</span>
</div>
<div>
<span>7</span>
<span>8</span><span>9</span>
</div>
.container {
text-align: center;
}
.child {
display: inline-block;
}
.container {
}
.child {
margin: 0 auto;
}
.container {
height: 100px;
line-height: 100px;
}
.child {
display: inline-block;
vertical-align: middle;
}
body {
position: relative
}
.container {
top: 50px; left: 50px; background: green
}
.child {
top: 50px; right: 50px; background: red
}
.container {
height: 200px;
position: relative;
background: green;
}
.child-container {
position: absolute;
height: 0;
overflow: visible;
top: 50%
}
.child {
height: 50px;
top: -25px;
position: relative;
background: yellow;
}
.container {
height: 200px;
display: table;
width: 100%
}
.child-container {
display: table-cell;
vertical-align: middle
}
.child {
height: 50px;
width: 50px;
background: yellow
}