点一个样式类到另一个? [英] Point one style class to another?

查看:141
本文介绍了点一个样式类到另一个?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个css类:

.foo {
  background-color: red;
}

那么我有一个为列表指定的类:

then I have a class specified for a list:

.list1 li {
  background-color: tan;
}

是否可以将一个样式类设置为指向另一个样式类?例如:

is it possible to set one style class to just point to another? Something like:

.list1 li {
  .foo;
}

不知道如何阐述 - 我只是想要.list李风格是我为.foo类定义的任何东西。

not sure how to articulate that - I just want the .list li style to be whatever I define for the .foo class.

感谢

推荐答案

您可以使用 selector grouping

.foo, .list1 li { 
  background-color: red; 
} 

这篇关于点一个样式类到另一个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆