Nesting HTML- anchor tags(嵌套 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 锚标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:嵌套 HTML 锚标记
基础教程推荐
- Javascript 在多个元素上单击事件侦听器并获取目标 2022-01-01
- Node.js 有没有好的索引/搜索引擎? 2022-01-01
- 什么是不使用 jQuery 的经验技术原因? 2022-01-01
- jQuery File Upload - 如何识别所有文件何时上传 2022-01-01
- 为什么我在 Vue.js 中得到 ERR_CONNECTION_TIMED_OUT? 2022-01-01
- 如何在特定日期之前获取消息? 2022-01-01
- WatchKit 支持 html 吗?有没有像 UIWebview 这样的控制器? 2022-01-01
- 如何使用 CSS 显示和隐藏 div? 2022-01-01
- 每次设置弹出窗口的焦点 2022-01-01
- 如何使用sencha Touch2在单页中显示列表和其他标签 2022-01-01
