Ask Your Question
3

Is it possible to refer to a CSS class inside a different CSS class?

asked 2022-02-09 11:00:00 +0000

djk gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-08-27 00:00:00 +0000

nofretete gravatar image

Yes, it is possible to refer to a CSS class inside a different CSS class. This can be achieved by using the class name as a selector for the nested class. For example:

.parent-class .nested-class {
   /* CSS rules for nested class */
}

In this example, the class "nested-class" is nested inside the class "parent-class". The CSS rules specified under this selector will only apply to elements that have both classes.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-02-09 11:00:00 +0000

Seen: 12 times

Last updated: Aug 27 '21