我有这个 CSS,但正如你所见,我对不同的类别重复同样的事情......我怎样才能减少这个代码?
.dropdown .cars-category{
float: left;
margin-left: 1%;
}
.dropdown .trucks-category{
float: right;
margin-right: 1%;
}
.dropdown .trucks-category > li > a {
display: block;
clear: both;
line-height: 20px;
color: #546aa4;
}
.dropdown .trucks-category > li.last > a {
border-bottom-width: 0;
}
.dropdown .trucks-category > li > a:hover,
.dropdown .trucks-category > li > a:focus,
.dropdown .trucks-category > .active > a,
.dropdown .trucks-category > .active > a:hover,
.dropdown .trucks-category > .active > a:focus {
color: #546aa4;
text-decoration: none;
background-color: #e7eded;
outline: 0;
}
.dropdown .cars-category > li > a {
display: block;
clear: both;
line-height: 20px;
color: #546aa4;
}
.dropdown .cars-category > li.last > a {
border-bottom-width: 0;
}
.dropdown .cars-category > li > a:hover,
.dropdown .cars-category > li > a:focus,
.dropdown .cars-category > .active > a,
.dropdown .cars-category > .active > a:hover,
.dropdown .cars-category > .active > a:focus {
color: #546aa4;
text-decoration: none;
background-color: #e7eded;
outline: 0;
}