CSS - 超链接不会去任何地方

发布于 2024-08-17 03:54:16 字数 845 浏览 9 评论 0原文

由于某种原因,我一直试图弄清楚,我的页面上的链接是可点击的,但实际上并没有去任何地方。标记本身看起来很好,我不知道 css 是否存在一些问题,导致它们毫无用处。我最近为 a 标签添加了 z 索引,但是没有效果。注意:下面的 CSS 取自 Firebug,而不是实际的样式表...

标记:

<li class="">
  <span id="thmr_93" class="thmr_call">
  <a href="/edit/1">Edit</a>
  </span>
</li>

CSS:

.tabs ul.primary, .tabs ul.primary li {
    float:left;
    line-height:normal;
    list-style-image:none;
    list-style-position:outside;
    list-style-type:none;
    margin:0;
    padding:0;
    text-align:left;
}

.tabs ul.primary li a {
    color:#008080;
    text-decoration:none;
    height:30px;
    line-height:30px;
    margin:10px;
    width:100%;
    z-index:100;
    list-style-image:none;
    list-style-position:outside;
    list-style-type:none;
    text-align:left;
}

For some reason that I've been trying to figure out, the links on my page are clickable, but aren't actually going anywhere. The markup itself looks fine, and I can't figure out if there's some issue with the css that is rendering them useless. I recently added in a z-index for the a tag, but, that had no effect. Note: The css below is taken from Firebug, not the actual stylesheet...

Markup:

<li class="">
  <span id="thmr_93" class="thmr_call">
  <a href="/edit/1">Edit</a>
  </span>
</li>

CSS:

.tabs ul.primary, .tabs ul.primary li {
    float:left;
    line-height:normal;
    list-style-image:none;
    list-style-position:outside;
    list-style-type:none;
    margin:0;
    padding:0;
    text-align:left;
}

.tabs ul.primary li a {
    color:#008080;
    text-decoration:none;
    height:30px;
    line-height:30px;
    margin:10px;
    width:100%;
    z-index:100;
    list-style-image:none;
    list-style-position:outside;
    list-style-type:none;
    text-align:left;
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

煮茶煮酒煮时光 2024-08-24 03:54:16

根据类的名称(.tabs ... 等),我猜测页面上有 JavaScript 试图使选项卡表现得像动态选项卡。

尝试从页面中删除所有

如果这解决了问题,那么页面上的某些内容正在控制您的标记以添加功能。查找名为 tabs.jsjquery-ui.js 等的文件。其中任何一个都可能导致该问题。

I am going to guess, based on the names of the classes (.tabs ... etc) that there is JavaScript on the page trying to make the tabs act like dynamic tabs.

Try removing all the <script> tags from the page (normally they are all in the head or at the bottom of the page) and seeing if it works.

If that fixes it, than something on your page is taking control of your markup to add functionality. Look for files named tabs.js or jquery-ui.js etc. Any of those could cause that problem.

你与清晨阳光 2024-08-24 03:54:16

此行是否附加了任何 javascript?如果 javascript onclick 事件返回 false,则不会跟踪该链接。 CSS 不能影响链接行为 AFAIK

Is there any javascript attached to this line? If a javascript onclick event returns false, the link does not get followed. CSS cannot influence link behaviour AFAIK

莫言歌 2024-08-24 03:54:16

第一步是减少问题。这可以通过注释掉所有 CSS 直到它再次工作,然后将属性一一添加回来来实现。

First step would be to reduce the problem. This would be achieved by commenting out any and all CSS until it works again, and then adding the properties back in one by one.

套路撩心 2024-08-24 03:54:16

您所在的页面是 /edit/1 吗?

只是为了好玩,将网址更改为完整 - 例如 http://websitename.com/edit/1

Is the page you're on /edit/1?

Just for a lark change the urls to be complete -- eg http://websitename.com/edit/1

oО清风挽发oО 2024-08-24 03:54:16

请注意,如果您有一些 jQuery 作用于链接,则该链接可能无法正常工作,因为 onClick 事件可能已绑定到某些其他函数。禁用页面上的 JavaScript 并尝试。

Note that if you have some jQuery acting on the link, the link may not appear to work, as the onClick event would have been bound to some other function. Disable JavaScript on the page and try.

看透却不说透 2024-08-24 03:54:16

选项卡可能正在加载/编辑ajax内容(我猜是这样),所以我也猜测页面上的javascript已经停止正常运行。

您可以使用 firebug 来调试页面:)

the tabs are probably loading / editing ajax content (i'm guessing this) and so i'm also guessing the javascript on the page has stopped functioning correctly.

you can use firebug to debug the page :)

荒路情人 2024-08-24 03:54:16

CSS 不会影响控件的行为。如果在该超链接上您附加了一个脚本,请尝试使用 firebug 对其进行调试。如果您有其他使用提交功能的脚本,请尝试禁用它们。如果失败,请尝试将相对链接放在 href 上,例如 href="~/folder/file.html" 或 ASPX 等。最终是“http://etc”的完整链接。

CSS does not influence the behaviour of your control. If on that hyperlink you have a script attached try debugging it with firebug. If you have other scripts that use the submit function try disabling them. And if that fails try putting the relative link on the href like href="~/folder/file.html" or ASPX or something. eventually the full link with "http://etc."

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文