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 锚标记


基础教程推荐
- Chart.js 在线性图表上拖动点 2022-01-01
- 我可以在浏览器中与Babel一起使用ES模块,而不捆绑我的代码吗? 2022-01-01
- 直接将值设置为滑块 2022-01-01
- Vue 3 – <过渡>渲染不能动画的非元素根节点 2022-01-01
- 如何使用TypeScrip将固定承诺数组中的项设置为可选 2022-01-01
- 自定义 XMLHttpRequest.prototype.open 2022-01-01
- 用于 Twitter 小部件宽度的 HTML/CSS 2022-01-01
- Electron 将 Node.js 和 Chromium 上下文结合起来意味着 2022-01-01
- html表格如何通过更改悬停边框来突出显示列? 2022-01-01
- 如何使用JIT在顺风css中使用布局变体? 2022-01-01