Tôi muốn biết cách tôi có thể đặt một cài đặt cho hai lớp khác nhau.Làm cách nào để đặt một quy tắc CSS cho hai thẻ?
Để đưa ra một ví dụ:
.footer #one .flag li .drop_down form div{
width: 80px;
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
text-align: left;
line-height: 1.5;
color: #ccc;
font-weight:bolder;
margin-left: 30px;
}
.footer #two .flag li .drop_down form div{
width: 80px;
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
text-align: left;
line-height: 1.5;
color: #ccc;
font-weight:bolder;
margin-left: 30px;
}
Cả hai quy tắc có cùng một nội dung. Sự khác biệt chỉ là thẻ thứ hai. Có cách nào để làm điều gì đó như thế này không?
.footer >>>#one and #two<<<< .flag li .drop_down form div{
width: 80px;
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
text-align: left;
line-height: 1.5;
color: #ccc;
font-weight:bolder;
margin-left: 30px;
}
Bạn nên [sử dụng bộ chọn CSS hiệu quả] (https://developers.google.com/ tốc độ/tài liệu/thực hành tốt nhất/hiển thị # UseEfficientCSSSelectors) nếu có thể. –