DEV Community

Cover image for There is a simple solution with CSS
Apoorva CG
Apoorva CG

Posted on

2

There is a simple solution with CSS

Usually CSS is hard! but not this time😄, an answer from Stack Overflow saved me a lot time and unwanted code. The requirement was to show icons onHover of a list item using react.

Came across this simple and efficient CSS solution without overengineering by @arunkhot,

There is simple solution with CSS Just add below CSS to the elements you want to show/hide on hover. By default put set CSS property

{
  display: none
}

Element would be visible on mouse hover with below CSS.

                '&:hover, &:focus-within': {
                  '.element-class':

Writing this appreciation post with the time saved😌

Top comments (0)

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay