-
-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathcss_example.html
More file actions
50 lines (45 loc) 路 1.29 KB
/
Copy pathcss_example.html
File metadata and controls
50 lines (45 loc) 路 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>CSS Example</title>
<meta name="description" content="simple CSS selectors" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
/* select all `div` elements */
div {
border: 1px solid blue;
margin: 10px;
}
/* select elements having class `header` */
.header {
background: steelblue;
color: white;
}
/* select the element with the id `main` */
#main {
border: 1px solid red; /* Overrides the rules from `div`, because `#main` is more specific */
}
/* select all `div` with class `header` */
div.header {
background: green; /* Overrides the rules from `.header`, because `div.header` is more specific */
}
/* select all descendent `p` within a `div` */
div p {
font-size: 200%;
}
/* matches when the mouse hovers a `div` */
div:hover {
background-color: orange;
}
</style>
</head>
<body>
<div class="header">D3 Test</div>
<div id="main">
<p class="header">Lorem Impsum Header</p>
<p>Lorem Impsum</p>
</div>
</body>
</html>