Change background on button click, using CSS only?

前端 未结 6 2136
囚心锁ツ
囚心锁ツ 2020-12-03 12:05

Is it possible to change the background color on button click; of the entire document, using only CSS and HTML5?

(e.g.: it\'s trivial in Ja

6条回答
  •  长情又很酷
    2020-12-03 12:51

    You could do something like this -- using the adjacent css selector :

    
    
    btn:active + .content{ background: blue; }

    http://jsfiddle.net/JeffreyTaylor/g47Uh/

提交回复
热议问题