-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathclassselectors.html
More file actions
37 lines (37 loc) · 1.02 KB
/
Copy pathclassselectors.html
File metadata and controls
37 lines (37 loc) · 1.02 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width= , initial-scale=1.0" />
<title>classselectors</title>
<style>
.classone h1 {
max-width: 100%;
background-color: lightgreen;
color: blue;
}
.classtwo h2,
h4 {
max-width: 100%;
background-color: lightblue;
color: darkred;
/*by giving a space between the class and the heading it selects all the elements present between the element that is using the class
--we can add the style to the multiple elements by adding new elements and than adding a comma between those elements
*/
}
</style>
</head>
<body>
<!--shit it is called decendent selector
-->
<div class="classone">
<h1>Heading Inside div using class one</h1>
</div>
<div class="classtwo">
<h1>Heading one</h1>
<h2>Heading Two</h2>
<h3>Heading three</h3>
<h4>Heading four</h4>
</div>
</body>
</html>