1

该链接仅在我单击实际文本而不是其周围区域时才有效,即使悬停效果有效,所以我知道按钮是目标?

这也发生在我正在使用左填充并将图像放在那里的站点内的列表中,如果我单击填充的位置它不起作用?

.js 脚本会影响这个吗,这一切都是为了我正在使用的灯箱

有任何想法吗??

ul#navigation { 
  list-style-type: none;
  margin: 0;
  padding: 0;
  padding: 0;
  }

ul#navigation li a {
  position: absolute;
  bottom: 10px; 
  display: block;
  width: 5em;
  padding: .5em 0;
  color: #FFF;
  background: #92da3a;
  text-align: center;
  text-decoration: none;
  font-size: 11px; 
  }

ul#navigation li a:hover {
  color: #05554f;
  }

ul#navigation .back {
  float: left;
  width: 4em;
  padding: 10px;
  }

ul#navigation .close {
  float: right;
  width: 4em;
  padding: 10px;
  }

ul#navigation li.mt {
  border-bottom: 2px solid #92da3a; 
  width: 480px; 
  position: absolute; bottom: 30px; left: 20px;
  }   

非常感谢 :)

4

4 回答 4

1

There is nothing wrong with the CSS for ul#navigation li a. I have copied your CSS to a working example and this appears to function correctly in FF3, IE7 and Chrome.

I wouldn't expect a (well written) piece of JavaScript to be interfering with your links in any way. Although, in general, a given piece of unknown JavaScript could be doing anything.

You have too many factors influencing the final rendering and behaviour to determine what may be the cause. You will need to start with a bare minimum and re-add all relevant factors until it breaks, or until everything is re-added and working correctly.

  • start with a (validating) plain (X)HTML document
  • add the relevant CSS to get the link styling you desire
  • add back the rest of the CSS, possibly piece-by-piece if some other CSS rules are interfering
  • add back your JavaScript, again piece-by-piece where relevant

After this process you should have a more clear idea of what factor is causing the undesired behaviour.

I'd recommend using the FireFox web developer toolbar to examine what CSS rules are being applied to your navigation links. You may find some other loosely-specified rules are interfering in otherwise unexpected ways.

You should also confirm your markup and CSS are valid - you can't accurately determine the correct output when dealing with invalid input.

于 2009-02-12T14:37:00.133 回答
0

让我猜猜,IE6?

您确实需要在此处指定问题所在的浏览器,因为不同的渲染引擎之间可能存在巨大差异。通常 IE6 与其他所有人相比,Safari 和 Opera 添加了他们的盐。

要回答您的问题,在 IE6 中,有时光标不会显示“手”图标,但单击该区域会触发链接。在这种情况下,添加“cursor:hand”(或其他任何内容,查找 css 属性)将为 IE6 修复该问题。

于 2009-02-12T23:15:18.423 回答
0

我尝试将 UL 或 LI 设置为相对位置,考虑到您将 A 设置为 position: absolute;

拥有这套可能会引起一些奇怪。

如果您还可以提供您正在使用的 HTML,那将有助于确定问题。

于 2009-02-13T08:15:01.510 回答
-1

在我的脑海中,我正在考虑将每个元素渲染为一个元素,然后将跨度的 onclick 事件设置为跟随链接并将所需的任何空格和文本放入跨度 () 中。

window.location = "URL!"
于 2009-02-11T17:58:53.453 回答