A
A
Ammino2015-02-27 03:12:20
css
Ammino, 2015-02-27 03:12:20

Sticky buttons/links with :hover effect on android?

There is an android, there is a button, as it is set - it does not matter (whether it is a button, or it is a simple link) with the usual styles. nothing complicated

.btn-green {
text-align: center; 
display: inline-block; 
font-size: 16px; 
padding: 10px 15px; 
line-height: 1; 
text-decoration: none;
position: relative;
border: none; 
color: #fff;
border-bottom: 1px solid #000;
background: #7fce55;
}
.btn-green:hover, .btn-green:focus {background: #368b24;}

so when you click on the button, an action occurs on the page, there is no transition and reloading of the page. But the :hover effect remains on the button.
The essence of the question: how to return the button to its normal state after releasing the user's finger from the android screen?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
P
phpus, 2015-02-27
@Ammino

Remove hover for all mobiles. There is a special function in css. Look.
Or do as I do at the server level =)

R
rmaksim, 2015-02-27
@rmaksim

it seems that you would like visual confirmation that some element is being clicked?
you can instead .btn-green:hover, .btn-green:focus {}
write .btn-green:active {}
and from the complex - it's scripts on the touchstart to put the class on the touchend to remove ... do you need it so much? )))

A
Ammino, 2015-02-27
@Ammino

Found a solution.
I had to use media and just such a plushtap-highlight-color: rgba(0, 0, 0, 0);

A
Anatoly, 2017-11-21
@kirill-93

This arrangement is called Masonry.
Solutions: CSS Grid or Masonry JS

I
Islam Ibakaev, 2017-11-21
@devellopah

bricks.js would be better than masonry

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question