2015-12-04 28 views
-3

如何爲一組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; 
} 
+0

您錯過了twitter前面的點(。)。 –

回答

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; 
} 
1

你必須使用:你只是在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; 
}