Can you use elm-ui or elm-css to make a child element display when hovering over its parent element?

In elm-css you can do this using the Css.Global module.

We use elm-css, but we prefer to do this with plain CSS. We have a global CSS file with:

.displayOnParentHover {
  display: none;
}
*:hover > .displayOnParentHover {
  display: block;
}

And then add class "displayOnParentHover" to the element.

4 Likes