首页 新闻 赞助 找找看

a标签失效的问题

0
悬赏园豆:10 [已解决问题] 解决于 2012-08-31 18:15

刚才调试了一下,在一个div(代号A)层中所有的a标签都会失效,在这个div层之外的a标签都能执行,我想问一下对Adiv中做什么样的设置后会造成里面的a标签失效?

让手指在键盘上飞舞的主页 让手指在键盘上飞舞 | 初学一级 | 园豆:82
提问于:2012-08-31 17:14
< >
分享
最佳答案
0

我猜是你这个Adiv被其他东西盖住了,检查下页面的css吧。

收获园豆:5
水牛刀刀 | 大侠五级 |园豆:6350 | 2012-08-31 17:30
其他回答(3)
0

是链接打不开,还是onclick没反应?前者应该是链接没了吧?

向往-SONG | 园豆:4853 (老鸟四级) | 2012-08-31 17:44

和页面文本一样,鼠标移上去没任何反应的那种

0

新建一个页面,把这个div放进去,看看里面的<a>是否有效

如果无效:检查你的<a>中的href或者onclick中是否有return false,或者js错误

如果有效:肯定是页面的css对你的这个div产生了影响,问题就集中到了查找并去掉这个影响

收获园豆:5
田林九村 | 园豆:2367 (老鸟四级) | 2012-08-31 18:03

OK.用你的方法把这个DIV放到另外一个页面A标签有效果。那肯定是页面上的CSS的影响,一般CSS什么属性会对A标签有这样的影响呢?

@让手指在键盘上飞舞: z-index, position

支持(0) 反对(0) 田林九村 | 园豆:2367 (老鸟四级) | 2012-08-31 18:13

@让手指在键盘上飞舞: 解决了,就是你第一种说的那个情况,我用position和z-index属性把这个div层放到最上面就解决了。大神啊~~~求QQ号;以后不懂的问你

@让手指在键盘上飞舞: 别这样

支持(0) 反对(0) 田林九村 | 园豆:2367 (老鸟四级) | 2012-08-31 18:15
0

我的下面的代码也是左侧的连接错误,拜托什么问题啊???

 

<!DOCTYPE html>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>This My First Web</title>

<meta charset="utf-8" />
<style>
.title {
border: 2px solid black;
position: fixed;
width: 1350px;
top: 0px;
}

ul {
list-style-type: none;
margin: 0;
padding: 0;
text-align: center;
}

ul a {
display: block;
width: 150px;
}


.index {
border: 2px solid black;
position: absolute;
top: 84px;
float: left;
height: 450px;
width: 150px;
}

.daohang {
font-size: large;
}

.backgrount {
background-image: url(1.jpg);
}

.main {
position: absolute;
float: right;
text-align: center;
border: 2px solid black;
height: 450px;
width: 1350px;
top: 84px;
}

.botton {
position: absolute;
border: 2px solid black;
width: 1350px;
height: 70px;
bottom: 0px;
}
</style>

</head>
<body class="backgrount">



<div>
<div class="title"><h1>&emsp;&emsp;&emsp;&emsp;
<a href="http://wwww.baidu.com" target="_blank">HOME</a>
<a href="http://www.youku.com" target="_blank"> VIDOL</a>
<a href="http://image.baidu.com" target="_blank">PICTURE</a>
</h1>

</div>
<div class="index">
<ul>
<li class="daohang"><a href="http://www.baidu.com" target="_blank">css</a></li>
<li class="daohang"><a href="http://www.w3school.com.cn/html/index.asp" target="_blank">html</a></li>
<li class="daohang"><a href="http://www.w3school.com.cn/b.asp" target="_blank">javascript</a></li>
</ul>
</div>
<div class="main">
<p>this is main idear you think you are a good hero!!!</p>
<p>
Welcome to hello world! Now you will see a diffrient world,and a very cool netweb!!!
Ara you realdy to see the amaziding!!!

</p>

</div>
<div class="botton">
<p style="color:red;">
&emsp; &emsp; &emsp; &emsp; &emsp; &emsp; &emsp; &copy; 版权所有归华庆责任有限公司 2016.05.13
</p>

</div>
</div>

</body>
</html>

 

鬼谷子先生 | 园豆:202 (菜鸟二级) | 2016-05-14 21:37
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册