Sunday, 9 June 2019

What is !important Declaration in CSS

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>
</html>


No comments:

Post a Comment

SEO introduction

What is SEO? SEO(Search Engine Optimization ) is a technique that helps to bring the Website on top. Seo depends on the Keyword . Ke...