【发布时间】:2014-09-08 16:52:48
【问题描述】:
我有 2 个 div,宽度相同,绝对定位,在页面上水平和垂直居中。
每个 div 都包含一个链接。但是只有一个链接是可点击的。我需要两个链接都是可点击的。
这是我的jsfiddle
<div class="button"> <a href="http://www.google.com" target="_blank">button</a> </div>
<div class="arrows"> <a href="http://www.google.com" target="_blank">arrows</a> </div>
.button, .arrows {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
width: 520px;
height: 240px;
margin: auto !important;
border: 1px solid #000;
}
.button { z-index: 999; }
.arrows { text-align: center; z-index:99999; }
.button a { border: 1px solid red; }
.arrows a { border: 1px solid yellow; }
任何提示将不胜感激。
谢谢。
【问题讨论】:
-
不要将它们放在一起。我不确定您要做什么,但这种 HTML/CSS 可能是错误的方法。
-
为什么要将 div 放置在绝对位置?为什么不将两个链接放在一个 div 中?在这里解释你要做什么
标签: html css position center absolute