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 锚标记
基础教程推荐
- npm start 错误与 create-react-app 2022-01-01
- 检查 HTML5 拖放文件类型 2022-01-01
- Fabric JS绘制具有活动形状的多边形 2022-01-01
- 原生拖动事件后如何获取 mouseup 事件? 2022-01-01
- 在 contenteditable 中精确拖放 2022-01-01
- fetch 是否支持原生多文件上传? 2022-01-01
- Bootstrap 模态出现在背景下 2022-01-01
- Bokeh Div文本对齐 2022-01-01
- 如何添加到目前为止的天数? 2022-01-01
- 即使用户允许,Gmail 也会隐藏外部电子邮件图片 2022-01-01
