Calcular un porcentaje con SCSS / SASS
Quiero establecer un ancho en porcentaje en scss a través del cálculo, pero me da errores..
CSS no válido después de "...- width: (4/12)%": expresión esperada (por ejemplo, 1px, negrita), era"; "
Quiero hacer algo como
$my_width: (4/12)%;
div{
width: $my_width;
}
¿Cómo agrego el signo % allí?
La misma pregunta con px y em
96
Author: Nick Ginanto, 2012-11-13
2 answers
¿Has probado la función percentage?
$my_width: percentage(4/12);
div{
width: $my_width;
}
176
Author: Tomas,
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
2012-11-13 11:13:15
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
2012-11-13 11:13:15
Otra manera:
$my_width: 4/12*100%;
div{
width: $my_width; // 33.33333%
}
Sass mostrará el valor en %.
23
Author: rlejnieks,
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-05-27 16:47:26
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-05-27 16:47:26