Anidamiento Sass para: hover no funciona [duplicar]
Esta pregunta ya tiene una respuesta aquí:
- Sass .scss: ¿Anidamiento y múltiples clases? 2 respuestas
He escrito este código, pero no funciona. ¿Cuál es mi problema?
.class {
margin:20px;
:hover {
color:yellow;
}
}
260
2 answers
Para concatenar selectores juntos al anidar, debe usar el selector padre(&
):
.class {
margin:20px;
&:hover {
color:yellow;
}
}
584
Author: Sinac,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-03-21 21:31:13
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-03-21 21:31:13
Puede depurar fácilmente tales cosas cuando pasa por el CSS generado. En este caso, el pseudo-selector después de la conversión tiene que estar conectado a la clase. Lo cual no es el caso. Utilizar "&".
Http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#referencing_parent_selectors_
.class {
margin:20px;
&:hover {
color:yellow;
}
}
34
Author: Enrico Stahn,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-04-13 02:48:19
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-04-13 02:48:19