10
I have a ul
where it is a menu in which items that are not inside a ul
son have the tag dropdown-toggle
. The items that are in ul
son doesn’t have that tag.
The class .navbar-solid
is applied to <ul>
father. I don’t want her to apply the properties of a
in those who do not have the class dropdown-toggle
, or in other words, within the ul
son. In the code below, it is applied to all a
.
.navbar-solid {
background-color: transparent !important;
transition: background-color 1s ease 0s;
}
.navbar-solid img {
filter: brightness(0) invert(1);
}
@media (min-device-width: 1100px) {
.navbar-solid a {
color: green !important;
transition: background-color 1s ease 0s;
}
.navbar-solid a:hover, i:hover {
color: blue !important;
transition: background-color 1s ease 0s;
}
}
<ul class="navbar-solid">
<li class="dropdown">
<a class="dropdown-item dropdown-toggle" href="xxx">
Aaaaa
</a>
</li>
<li class="dropdown">
<a class="dropdown-item dropdown-toggle" href="xxx">
Bbbbb
</a>
</li>
<ul class="dropdown-menu">
<li class="dropdown">
<a class="dropdown-item" href="xxx">
Sub-item
</a>
</li>
<li class="dropdown">
<a class="dropdown-item" href="xxx">
Sub-item 2
</a>
</li>
</ul>
<ul>
How do I filter in CSS?
Who negatived could please say what’s wrong, so I can learn tbm?
– LeAndrade
It was not me who gave -1, but how is the
a:hover
will be applied to all cases. By chance the color that is is the same as the default. Movecolor:blue
forcolor:red
you’ll notice the difference.– Jorge B.
Hmmm... right Jorge now understood, had not attacked me Hover, although the logic is the same by adding the selector in the Hover.
– LeAndrade