Sélecteur CSS3, nième enfant d'incrémentation de 1
-
26-12-2019 - |
Question
J'utilise le sélecteur CSS3 pour sélectionner différents enfants.Est-ce que leur alternative au lieu de la codage de la vitesse supérieure
.checkout_main .check_tr th:nth-child(1){
width:50px;padding-left:10px;
}
.check_tr th:nth-child(2){
width:300px;padding-left:10px;
}
.check_tr th:nth-child(3){
width:50px;padding-left:10px;
}
.check_tr th:nth-child(4){
width:100px;padding-left:10px;
}
La solution
Il y a deux alternatives
You can use odd even
:nth-child(odd)
{
width: 100px;
}
:nth-child(even)
{
width:200px;
}
Une autre solution est que vous devez formuler un + b.Ensuite, cela fonctionne, laissez-moi savoir votre HTML.Ii ll essayer de vous dire un formulaire + B.
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow