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

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

问题描述

今天,我正在为一个网页制作一个标签导航。我尝试了 Sliding Doors 方法,它工作正常。然后我意识到我必须包含一个选项来删除一个选项卡(通常是每个选项卡右下角的一个小X)。

我想使用一个嵌套的锚点,它不起作用,因为它是不允许。然后,我看到 Pageflakes 上的tab导航实际上正在运行(包括嵌套超链接)。为什么?

解决方案

他们必须使用JavaScript来做一些非常疯狂的事情才能使其发挥作用(请注意,嵌套锚定标记具有名称或href属性 - 所有功能都通过类名称和JS完成。)



以下是html的样子:

 < a class =page_tab page_tab> 
< div class =page_titletitle =点击重命名此页面。>点击&输入页面名称< / div>
< / a>


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).

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?

解决方案

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).

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天全站免登陆