是否可以创建html标签h7,h8,h9等 [英] Is it possible to create html tags h7, h8, h9 and so on

查看:306
本文介绍了是否可以创建html标签h7,h8,h9等的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个新手问题.是否可以创建更多的标题样式,例如h7,h8等.我想知道一个网站上是否可能有超过6种不同的标题.

Here's a novice question. Is it possible to create more heading styles like h7, h8, and so on. I am just wondering if it possible to have more than 6 different types of headings on a website.

推荐答案

您可以在页面上创建任何想要的元素,但是我认为您的问题是,用户代理(如浏览器)是否可以正确解释该元素.浏览器将允许您在DOM上创建,应用样式以及访问DOM上任意创建的元素,而不管它们是否符合声明的DOCTYPE所隐含的规范.

You can create any element you want on a page, but I think your question is whether it will be interpreted correctly by a user agent like a browser. Browsers will allow you to create, apply styles to, and access arbitrarily-created elements on the DOM regardless of whether they conform to the spec implied by your declared DOCTYPE.

但是,通常最好避免创建深度嵌套的结构.用户发现很难遵循这样的层次结构.此外,正如评论中链接的其他答案所指出的那样,页面可访问性,SEO或脚本兼容性可能会带来意想不到的后果.除了将较长的法律文档作为单个HTML页面发布时,我还没有找到一个实际需要如此深层嵌套的层次结构的用例.

However, in general, it's best to avoid creating deeply nested structures; users find such hierarchies difficult to follow. In addition, as other answers linked in the comments have pointed out, there may be unintended consequences with page accessibility, SEO, or script compatibility. I have yet to find a use case that actually needs such deeply nested hierarchies, except when posting long legal documents as a single HTML page.

这篇关于是否可以创建html标签h7,h8,h9等的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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