Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS buttons for touch devices?

I'm building a site and have lots of buttons, problem is, if i only add the .active state to the button, nothing shows on the button, and if i add a hover state, then at least one button shows a pressed state when loading the site, and if i click on another button it will always be in hover state. Is there a way around this?

Best

like image 614
Iyad Avatar asked Feb 21 '26 13:02

Iyad


1 Answers

You can achieve this on a touch device by binding the touchstart / touchend events using javascript.. Check out BGerrissen's answer

like image 145
Pierre Avatar answered Feb 23 '26 01:02

Pierre