html - How to make a ccs transition only forward -


I have an app that changes from opacity 0 to opacity 1 if you hover a div, then I get the CSS transition How can i 2 for "0 to 1" opacity change and not for "1 to 0"

You can do this by simply adding CSS to the transition to Hover State CSS.

HTML
  
gt; & Lt; / Div & gt;

CSS
  div {width: 100px; Height: 100 pixels; Background: green; } div: Hover {Opacity: 0; Transition: Opacity .2s; }   

demo



Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -