CSS3 transition on click using pure CSS

前端 未结 6 1023
鱼传尺愫
鱼传尺愫 2020-11-27 04:04

I\'m trying to get an image (a plus symbol) to rotate 45 degrees to create a cross symbol. I have so far managed to achieve this using the code below but its working on hove

6条回答
  •  我在风中等你
    2020-11-27 04:42

    You can also affect differente DOM elements using :target pseudo class. If an element is the destination of an anchor target it will get the :target pseudo element.

    
    
    Click me
    

    And I will change

    Here is a fiddle : https://jsfiddle.net/k86b81jv/

提交回复
热议问题