Penyambungan Pseudokelas dalam LESS
Ampersand mudah digunakan semasa bekerja dengan pseudokelas. Lihat contoh:
a {
color: blue;
&:hover {
color: red;
}
}
Hasil kompilasi:
a {
color: blue;
}
a:hover {
color: red;
}
Terangkan, apakah hasil kompilasi kod berikut:
a.class {
&:link {
color: red;
}
&:visited {
color: blue;
}
&:hover {
color: green;
}
}
Permudahkan kod yang diberikan:
#block {
width: 300px;
}
#block a:link, #block a:visited {
color: red;
}
#block a:hover {
color: blue;
}