0

I can't seem to recollect how to do this CSS only trick where one can hover over an element and the effect of the hover stays forever. I know it had something to do with transition being set to 9999s meaning it will take forever to return back to normal, hence the end result stays. This is good for making css only dialog boxes to stay open.

Using the following HTML and CSS elements:

<div>
  something here
</div>

CSS:

div { width: 100px: height: 100px; transition: all 9999s; }

div:hover { height: 300px }
Patoshi パトシ
  • 21,707
  • 5
  • 29
  • 47
  • 1
    https://stackoverflow.com/questions/17100235/make-css-hover-state-remain-after-unhovering this might be what you're looking for – Fatfingers Feb 07 '23 at 21:04
  • @Fatfingers kind of.. but not exactly.. it had something to do with timing of the effect being 99999s. I'm not sure if the transition property is able to take in 2 inputs. One for starting the hover effect and then a return time delay, which is what I'm looking for. there was an article written about it some time ago. – Patoshi パトシ Feb 07 '23 at 21:50
  • Perhaps a transition delay as described in this post? [https://stackoverflow.com/a/17101357](https://stackoverflow.com/a/17101357) – Forceflow Feb 07 '23 at 22:31

0 Answers0