CSS实现超级链接需要通过双击后跳转

前端技术 2023/09/06 CSS
CSS代码

复制代码
代码如下:

.test3 span {
position: relative;
}
.test3 span a {
position: relative;
z-index: 2;
}
.test3 span a:hover, .test3 span a:active {
z-index: 4;
}
.test3 span input {
background: transparent;
border: 0;
cursor: pointer;
position: absolute;
top: -1px;
left: 0;
width: 101%; /* Hacky */
height: 301%; /* Hacky */
z-index: 3;
}
.test3 span input:focus {
background: transparent;
border: 0;
z-index: 1;
}


html代码

复制代码
代码如下:

<div class=\"test3\">
<span><input type=\"text\" value=\"&nbsp;\" readonly=\"true\" />
<a href=\"http://www.baidu.com\">Double click me</a></span>
</div>

本文地址:https://www.stayed.cn/item/17264

转载请注明出处。

本站部分内容来源于网络,如侵犯到您的权益,请 联系我

我的博客

人生若只如初见,何事秋风悲画扇。