Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to add parent class in css file?

Tags:

html

css

how to add parent class in css file

sourcse css

.pagination {
   font-size: 10px
}
a {
   font-size: 30px
}
...............

To get something like this

.parent-class {
   .pagination {
        font-size: 10px
   }
   a {
     font-size: 30px
   }
   ...............
}

It should be a lot of it will automatically wrap

like image 722
litehause Avatar asked Feb 08 '23 01:02

litehause


1 Answers

the structure you have is sass/scss/less.

In css, you do it like so:-

.parent-class .pagination {
        font-size: 10px
}
.parent-class a {
     font-size: 30px
}
...............

Once sass/scss/less is compiled, it generates the css structure above.

like image 158
BenG Avatar answered Feb 16 '23 02:02

BenG