您的位置:首页 > Web前端 > CSS

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

2013-10-12 17:45 627 查看
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=" " readonly="true" />
  <a href="http://www.baidu.com">Double click me</a></span>
</div>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: