Reputation: 33
I have creating webpage in angular. i have three stylesheets. these three files are called in all pages. Now, I want to execute specific CSS block for my home page. I tried less file for this process.
HTML:
// This code for home page
<div class="homePage">
<div class="content">
</div>
</div>
//This code for inner page
<div class="content">
</div>
CSS:
.homePage
{
.content
{
background-color: #F00;
color: #FFF;
}
}
.content
{
background-color: #000;
color: #FFF;
}
But its not working. please help me.
Upvotes: 2
Views: 1027
Reputation: 82
You can have a global style for .content
div
.content {
background-color: #000;
color: #FFF;
}
Whenever you want to override the .content
div style or add page specific style, simply just wrap .content
div into a parent div
<div class="home-page">
<div class="content"></div>
</div>
.home-page .content {
background-color: #F00;
}
Upvotes: 3