一组属性的多个CSS选择器

时间:2015-12-04 06:25:54

标签: html css

如何为一组CSS属性选择多个元素?

例如,我该如何正确地执行此操作?:

.facebook:hover,twitter:hover {
    padding-left: 50px;
    opacity: 1.0;
    -webkit-transition: all .7s ease;
    -moz-transition: all .7s ease;
    -ms-transition: all .7s ease;
    -o-transition: all .7s ease;
    transition: all .7s ease;
    border-radius: 0px 10px 10px 0px;
}

2 个答案:

答案 0 :(得分:4)

这是可能的。你在twitter之前只缺少.facebook:hover, .twitter:hover { padding-left: 50px; opacity: 1.0; -webkit-transition: all .7s ease; -moz-transition: all .7s ease; -ms-transition: all .7s ease; -o-transition: all .7s ease; transition: all .7s ease; border-radius: 0px 10px 10px 0px; }

Date()

答案 1 :(得分:1)

你必须在twitter课程之前使用 dot(。)

.facebook:hover, .twitter:hover {
padding-left: 50px;
opacity: 1.0;
-webkit-transition: all .7s ease;
-moz-transition: all .7s ease;
-ms-transition: all .7s ease;
-o-transition: all .7s ease;
transition: all .7s ease;
border-radius: 0px 10px 10px 0px;
}