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 18, 2024
1 parent 3abd2cc commit 7584132
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions CSS specificity.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=z, initial-scale=1.0">
<title>Document</title>
<style>
/* The specificity of this selector is 1 */
h1 {
color: yellow;
}

/* This is an example of an attribute selector. The specificity of this selector is 10 */
[data-x=a]{
color: green; /* [Attribute selector] */
}

/* The specificity of this selector is 1 + 10 = 11*/
h1.cpurple {
color: purple;
}
/* The specificity of this selector is 10 */
.cred {
color: red;
}

/* The specificity of this selector is 1 + 10 + 10 + 10 + 10 = 41 */
a.harryclass.rohan-class[href]:hover {
color: blueviolet;
}

</style>
</head>

<body>
<div>
<h1 class="yellow cred cpurple" data-x="a">CSS Specificity</h1>
</div>

</body>

</html>

0 comments on commit 7584132

Please sign in to comment.