mobile safari links retains focus after touch

前端 未结 8 550
天涯浪人
天涯浪人 2020-12-13 13:33

My navigation is quite simple. I have a hover state which adds a border and a transparent gradient png background to some text, and an additional class which, when added by

8条回答
  •  忘掉有多难
    2020-12-13 14:05

    If you are using SCSS, I recommend you do the following:

    // primary-buttons
    .primary-button, .primary-button:visited,
    .primary-button:focus {
        background: red;
        color: white;
    }
    
    .primary-button:hover {
        background: green; // Only for big screens
        @media(max-width: 768px) {
            background: red;
        }
    }
    

    If you reset the value of the background to the initial value, you will no longer have problems with the button being pressed on devices <= 768px resolution

提交回复
热议问题