Combining Pseudo-Classes in LESS
The ampersand is useful when working with pseudo-classes. See the example:
a {
color: blue;
&:hover {
color: red;
}
}
Compilation result:
a {
color: blue;
}
a:hover {
color: red;
}
Tell me what the result of compiling the following code will be:
a.class {
&:link {
color: red;
}
&:visited {
color: blue;
}
&:hover {
color: green;
}
}
Simplify the given code:
#block {
width: 300px;
}
#block a:link, #block a:visited {
color: red;
}
#block a:hover {
color: blue;
}