嵌套 HTML 锚标记 [英] Nesting HTML- anchor tags

查看:29
本文介绍了嵌套 HTML 锚标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天我正在研究网页的标签导航.我尝试了 滑动门 方法,效果很好.然后我意识到我必须包含一个删除选项卡的选项(通常是每个选项卡右上角的一个小 X).

Today I was working on a tab navigation for a webpage. I tried the Sliding Doors approach which worked fine. Then I realized that I must include an option to delete a tab (usually a small X in the right corner of each tab).

我想使用嵌套锚,但它不起作用,因为它是 不允许.然后我在 Pageflakes 上看到了选项卡导航,它实际上在工作(包括嵌套的超链接).为什么?

I wanted to use a nested anchor, which didn't work because it is not allowed. Then I saw the tab- navigation at Pageflakes, which was actually working (including nested hyperlinks). Why?

推荐答案

他们必须用 JavaScript 做一些非常疯狂的事情才能让它工作(注意父锚标签和嵌套锚标签都没有 name 或 href 属性 -所有功能都是通过类名和 JS 完成的).

They must be doing some really crazy stuff with JavaScript to get it to work (notice how neither the parent nor the nested anchor tags have a name or href attribute - all functionality is done through the class name and JS).

这是 html 的样子:

Here is what the html looks like:

<a class="page_tab page_tab">
  <div class="page_title" title="Click to rename this page.">Click & Type Page Name</div>
  <a class="delete_page" title="Click to delete this page" style="display: block;">X</a>
</a>

这篇关于嵌套 HTML 锚标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆