-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4c821a4
commit 16ef391
Showing
1 changed file
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>CSS selectors</title> | ||
<style> | ||
/* Element Selector */ | ||
div{ | ||
/* background-color: red;*/ | ||
} | ||
/* Class selector*/ | ||
.red{ /* [.red means class is red]*/ | ||
background-color: red; | ||
} | ||
|
||
/*ID selector*/ | ||
#green{ | ||
background-color: green; | ||
} | ||
|
||
/*child selector*/ | ||
div > p { | ||
color: blue; | ||
background-color: brown; | ||
} | ||
|
||
/* descendant Selector*/ | ||
div p { | ||
color: blue; | ||
background-color: brown; | ||
} | ||
|
||
/* Universal Selector */ | ||
*{ | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
/* pseudo Selector */ | ||
a:visited{ | ||
color: yellow; | ||
} | ||
|
||
a:link { | ||
color: green; | ||
} | ||
|
||
a:active{ | ||
color: red; | ||
} | ||
|
||
a:hover{ | ||
color: orange; | ||
} | ||
|
||
|
||
p:first-child{ | ||
background-color: aqua; | ||
} | ||
|
||
</style> | ||
</head> | ||
<body> | ||
<main class="one"> | ||
<p>i am first</p> | ||
<p>i am second</p> | ||
</main> | ||
<div id="green"> | ||
<article> | ||
I am a div | ||
<p>I am a para inside div</p> | ||
</article> | ||
</div> | ||
|
||
<div class="red"> | ||
hello world | ||
<p>I am hero</p> | ||
</div> | ||
<a href="https://www.Google.com">Go to Google</a> | ||
<a href="https://www.Facebook2.com">Go to Facebook</a> | ||
|
||
</body> | ||
</html> |