CSS matches multiple classes The following HTML tag li, class has open style. My requirement is to change the background color to white only when open and active exist at the same time <li id="menu_268098" title="Account Information Query" class="open"> <li id="menu_270008" class="nav_sec" title="Account Balance Query"> <a href="#/p/payment.search.account_balance" class="dropdown-toggle"> <span class="nav-title">Account Balance Inquiry</span> </a> </li> </ul> </li> <li id="menu_268098" title="Account Information Query" class="open active"> <li id="menu_270008" class="nav_sec" title="Account Balance Query"> <a href="#/p/payment.search.account_balance" class="dropdown-toggle"> <span class="nav-title">Account Balance Inquiry</span> </a> </li> </ul> </li> The css can be written like this: li.open.active{ background-color: #fff; } Note: There should be no space between .open.active Summarize This is the end of this article about how to match multiple classes in CSS. For more information about how to match multiple classes in CSS, please search previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future! |
<<: Fixed table width table-layout: fixed
>>: 5 Reasons Why Responsive Web Design Isn’t Worth It
After installing the latest Windows 10 update, I ...
Table of contents 1. Main functions 2. Implementa...
Run cmd with administrator privileges slmgr /ipk ...
Table of contents 1. Basic Introduction to JavaSc...
Today is another very practical case. Just hearin...
1. Compare the old virtual DOM with the new virtu...
A style sheet describes how a document should be ...
Preface We all know that MySQL uses server-id to ...
The reason is that it was not uninstalled cleanly...
This article shares the installation and configur...
HTML implements 2-column layout, with fixed width...
A few days ago, I watched a video of a foreign gu...
Table of contents Block-level functions Directly ...
1. Background Generally, in a data warehouse envi...
According to the coefficient of pi and the radius...