Share
How to write this in SASS?
Question
Anyone knows how to write this css code in SASS?
nav ul li:hover > ul {
display:inherit;
}
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Answer ( 1 )
In SASS, you can write this CSS code as follows:
The “&” symbol refers to the parent selector, and “>” is the direct descendant combinator. The :hover pseudo-class is used to apply styles to an element when the user hovers over it with the mouse.
You can also write this code using the @extend directive:
This code creates a %show-submenu placeholder class that is extended by the ul element when the parent li element is hovered over. The “%” symbol indicates that the %show-submenu class is a placeholder and will not generate any CSS on its own. It is used as a way to share styles across different rules in a stylesheet.