Skip to content

Commit 6972a66

Browse files
committed
till id selector
0 parents  commit 6972a66

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

Readme.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# CSS
2+
3+
-> Simple Selector
4+
-> Element Selector
5+
-> Class Selector
6+
-> ID Selector
7+
-> Pseudo-class Selector
8+
-> Multiple Selector
9+
10+
## Element Selector
11+
12+
style applied on elements by directyly using the tag name ex
13+
paragraph <p>, body <body>, header <header>, footer <footer> , <h1>, <h6> etc .
14+
15+
we can style them by justing using there name like this
16+
p{
17+
property-name : value;
18+
}
19+
h1{
20+
property-name: value ;
21+
}
22+
23+
## Class Selector
24+
25+
class selector is used to group the element tag to apply common style
26+
for that in element tag we have to write class="name".
27+
and to style that element using that class name we can use dot ( . )
28+
ex :
29+
.name{
30+
property-name : value;
31+
}
32+
33+
note : class is used to group element together to apply common style , so one class can be applied to many .
34+
35+
## ID Selector
36+
37+
Id selector is used to set uniquness for an element . and can be write on element as id="unique-name"
38+
to style id based element we can use # (hash)
39+
ex
40+
#unique-name{
41+
property-name : value;
42+
}
43+
44+
## Pseudo-class Selector

index.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Document</title>
8+
9+
<style>
10+
p:hover {
11+
color: red;
12+
}
13+
</style>
14+
</head>
15+
<body>
16+
<p>hello</p>
17+
</body>
18+
</html>

0 commit comments

Comments
 (0)