I have a css class like:
.foo { background-color: red; }
then I have a class specified for a list:
.list1 li { background-color: tan; }
is it possible to set one style class to just point to another? Something like:
.list1 li { .foo; }
not sure how to articulate that - I just want the .list li style to be whatever I define for the .foo class.
How do you call @extend? Instead of calling those classes in the html, we will tell the class to inherit the rules into its styling. In order to @extend the styling rules of a css class into another, you use the syntax @extend . classname; .
Nested rules are defined as a set of CSS properties that allow the properties of one class to be used for another class and contain the class name as its property. In LESS, you can use class or ID selectors to declare mixin in the same way as CSS styles.
The inherit CSS keyword causes the element to take the computed value of the property from its parent element. It can be applied to any CSS property, including the CSS shorthand property all . For inherited properties, this reinforces the default behavior, and is only needed to override another rule.
To specify multiple classes, separate the class names with a space, e.g. <span class="left important">. This allows you to combine several CSS classes for one HTML element. Naming rules: Must begin with a letter A-Z or a-z.
You can use selector grouping:
.foo, .list1 li { background-color: red; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With