如何在CSS中继承类值

时间:2016-07-28 22:47:47

标签: css inheritance frontend

我如何从a:link,a:visited,a:active to .menunav:hover

继承

我有这样的代码

a:link, a:visited, a:active {
   color: white !important;
   text-decoration: none !important;
}

.menunav:hover {
   color: white !important;
   text-decoration: none !important;
   background: #333;
   transition-duration: 0.5s;
}

我想继承

color: white !important; text-decoration: none !important;

2 个答案:

答案 0 :(得分:0)

要在第二个元素类型中包含这些属性,您可以将属性复制粘贴到第二个规则中,如上所述,或者让选择器出现在两个规则中。

a:link, a:visited, a:active, .menunav:hover {
   color: white !important;
   text-decoration: none !important;
}

.menunav:hover {
   background: #333;
   transition-duration: 0.5s;
}

答案 1 :(得分:0)

report = self._get_report_from_name(cr, uid, report_name)
相关问题