Change button:active in css

后端 未结 4 2050
面向向阳花
面向向阳花 2021-01-28 07:40

how i can change button to have border-radius: 6px; and to by active marked when i will select it. Here is my HTML code and i also have CSS. When i make

4条回答
  •  清歌不尽
    2021-01-28 08:28

    In CSS, colons have a special meaning: they introduce pseudo-classes.

    Therefore, if you want to select the following HTML by its class...

    
    

    ...you must escape the colon:

    .button\:active
    

    .button\:active {
      background-color: #2B2B2B;
      border: 0px;
      display: inline-block;
      padding: 3px 10px 4px;
      color: #fff;
      text-decoration: none;
      -moz-border-radius: 6px;
      -webkit-border-radius: 6px;
      border-radius: 6px;
      -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.6);
      -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.6);
      text-shadow: 0 -1px 1px rgba(0,0,0,0.25);
      border-bottom: 1px solid rgba(0,0,0,0.25);
      position: relative;
      cursor: pointer;
      margin: 4px 2px;
    }

提交回复
热议问题