Ich habe diesen Code: (die ng-repeat kann als für Schleifen gedacht werden)Stellen auf Hoverschaltfläche einer Drop-Down-Menü Drop-Down-Anzeige
<div style="width: 10vw; display: inline-block; border: 1px solid blue;"></div>
<div class= "dropdown" index="$index + 1" ng-repeat = "cat in catData" id="{{cat.id}}" style="display: inline-block; border: 1px dotted #0000FF;">
<div style="width: 8vw; display: inline-block; border: 1px solid blue;"></div>
<button style ="width:25px; height: 25px; border-radius: 50%; border: 2px solid blue;
position:relative; left: -3px; bottom: -2px;" class="btn btn-default
dropdown-toggle categoryButtons" type="button" data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false">
</button>
<ul class="dropdown-menu" aria-labelledby="{{cat.id}}">
<li ng-repeat="subcat in subcatData" ng-if="subcat.parent === cat.id" id="{{subcat.id}}" ng-click="article('{{subcat.url}}')">
<a href =""><span class="content">{{subcat.name}}</span></a>
</li>
</ul>
</div>
, die diese Klassen hat: Drop-Down für die Dropdown-Listen und dropdown- Schalten Sie für die Schaltflächen und dann Drop-Down-Menü. Ich möchte es so machen, dass, wenn die Schaltfläche: Hover aktiviert ist, das Dropdown-Menü angezeigt wird.
Im Folgenden ist der CSS-Code:
.categoryButtons:hover {
background-color: blue !important;
}
.categoryButtons.btn[aria-expanded="true"] {
background-color: blue !important;
}
CSS-Lösung ist sehr einfach – 0aslam0