Important declaration are defined as that declaration which is having more importance then the normal declarationex: color: green !important;
In css Selector Priority Rules:
inline >id > class > internal css > External css.
<!Doctype html>
<html>
<head>
<title> Css Important </title>
<style>
.cs{
color: red;
}
</style>
</head>
<body>
<h2 class="cs"> Rajashree Tripathy</h2>
</body>
</html>
Out Put
Use ID in html code
<!Doctype html>
<html>
<head>
<title> Css Important </title>
<style>
.cs{
color: red;
}
#cd{
color:blue;
}
</style>
</head>
<body>
<h2 class="cs" id="cd"> Rajashree Tripathy</h2>
</body>
</html>
Out put
Use Important
<!Doctype html>
<html>
<head>
<title> Css Important </title>
<style>
.cs{
color: red !important;
}
#cd{
color:blue;
}
</style>
</head>
<body>
<h2 class="cs" id="cd"> Rajashree Tripathy</h2>
</body>
No comments:
Post a Comment