Check whether there is only one child item using CSS
In breadcrumbs, for example, icons are often assigned for illustrating the following entries. However, under certain circumstances there may only be the initial entry, so the icon points to a blank space.
.breadcrumb--item:only-child {
svg {
display: none;
}
}
Issue:
In breadcrumbs, for example, icons are often assigned for illustrating the following entries. However, under certain circumstances there may only be the initial entry, so the icon points to a blank space.
Solution:
Make use of the `:only-child` pseudo-class to determine whether there is only one item in the breadcrumb. See more in the Mozilla Dev Documentation
Also check "caniuse" for compatibility information: https://caniuse.com/?search=only-child
Ihre Drupal-Website zukunftssicher machen
Wir prüfen Ihr System und zeigen, was Sie für AI, Wartung und Upgrades brauchen.