Change background on button click, using CSS only?

前端 未结 6 2140
囚心锁ツ
囚心锁ツ 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:57

    There is a way to do it:

    .cc2:focus {
    background-color: #19A3FF;}
    

    The :focus basically means when you click on the element with the class cc2 it will turn it's background blue :) Hope that helps.

提交回复
热议问题