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