简体   繁体   中英

Link Clicked Change Button

I have a link and i put a button (pic) for it and i want when the link is clicked the button (pic) change like the visited links when it turns to purple

<td><a id="download" href="<?=$row['download_link']?>" target="_blank"><img src="download.png"></a></td>

can it be changed in html or have to do something in css and what is it

在此处输入图片说明 to 已下载

You can do this in plain CSS by removing the img from the a , and adding the following:

<style type="text/css">
    #download 
    {
      background-image:url(download.png);
      display:block;
      /* todo : put height and width of image here */
      width:100px; 
      height:100px;
    }

    #download :visited
    {
      background-image:url(download_visited.png);
    }
</style>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM