Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
akshitbansal2005 authored Feb 15, 2024
1 parent 4c821a4 commit 16ef391
Showing 1 changed file with 84 additions and 0 deletions.
84 changes: 84 additions & 0 deletions CSS Selector.html
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>

0 comments on commit 16ef391

Please sign in to comment.