Pressed <button> selector

后端 未结 5 1309
小鲜肉
小鲜肉 2020-11-27 03:58

I\'d like to create a button that changes its style when it gets pressed. This is my CSS code:

5条回答
  •  猫巷女王i
    2020-11-27 04:49

    You can do this with php if the button opens a new page.

    For example if the button link to a page named pagename.php as, url: www.website.com/pagename.php the button will stay red as long as you stay on that page.

    I exploded the url by '/' an got something like:

    url[0] = pagename.php

    
    
    
    
    
      
    
    
       Click Me
    
    
    

    note: I didn't try this code. It might need adjustments.

提交回复
热议问题