如何在图像的某些部分上显示一个小框?

时间:2018-05-16 15:41:34

标签: javascript html css

我有一个图像,其中有多个部分使用图像地图,我喜欢它,所以当用户将鼠标悬停在图像上时,一个小框出现在图像的指定部分上,并带有一个按钮"点击此处下载PDF"

<img style=" display: block; margin-left: auto; margin-right: auto; padding-bottom: 30px" 
                        src="myimage.png" alt="" width="983" height="634" usemap="#imageMap"/>
                        <map name="imageMap">
                            <area shape="rect" coords="20,400,182,200" href="" style="outline: none">
                            <area shape="rect" coords="480,400,200,200" href="mypdf.pdf" style="outline: none" download>
                            <area shape="rect" coords="650,400,500,220" href="#image4" style="outline: none">
                            <area shape="rect" coords="665,420,900,280" href="#image5" style="outline: none">
                            <area shape="rect" coords="765,425,900,575" href="#image6" style="outline: none">
                            <area shape="rect" coords="250,425,500,575" href="#image7" style="outline: none">
                        </map>

截至目前,我可以点击该区域进行下载,但我希望在图像的这一部分上显示一个小方框,并提供下载选项。

0 个答案:

没有答案