• <bdo id='1toig'></bdo><ul id='1toig'></ul>

    <small id='1toig'></small><noframes id='1toig'>

    1. <i id='1toig'><tr id='1toig'><dt id='1toig'><q id='1toig'><span id='1toig'><b id='1toig'><form id='1toig'><ins id='1toig'></ins><ul id='1toig'></ul><sub id='1toig'></sub></form><legend id='1toig'></legend><bdo id='1toig'><pre id='1toig'><center id='1toig'></center></pre></bdo></b><th id='1toig'></th></span></q></dt></tr></i><div id='1toig'><tfoot id='1toig'></tfoot><dl id='1toig'><fieldset id='1toig'></fieldset></dl></div>
      <legend id='1toig'><style id='1toig'><dir id='1toig'><q id='1toig'></q></dir></style></legend>

    2. <tfoot id='1toig'></tfoot>
    3. h1 和跨度

      h1 and the span(h1 和跨度)
        <bdo id='5C2Pp'></bdo><ul id='5C2Pp'></ul>
            <tbody id='5C2Pp'></tbody>
          • <small id='5C2Pp'></small><noframes id='5C2Pp'>

          • <tfoot id='5C2Pp'></tfoot>
          • <i id='5C2Pp'><tr id='5C2Pp'><dt id='5C2Pp'><q id='5C2Pp'><span id='5C2Pp'><b id='5C2Pp'><form id='5C2Pp'><ins id='5C2Pp'></ins><ul id='5C2Pp'></ul><sub id='5C2Pp'></sub></form><legend id='5C2Pp'></legend><bdo id='5C2Pp'><pre id='5C2Pp'><center id='5C2Pp'></center></pre></bdo></b><th id='5C2Pp'></th></span></q></dt></tr></i><div id='5C2Pp'><tfoot id='5C2Pp'></tfoot><dl id='5C2Pp'><fieldset id='5C2Pp'></fieldset></dl></div>

                <legend id='5C2Pp'><style id='5C2Pp'><dir id='5C2Pp'><q id='5C2Pp'></q></dir></style></legend>

                本文介绍了h1 和跨度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                在我的 html 中使用 h1-h6 标签时,我不断收到关于 w3c 验证器的错误消息.我是新手,我已经尝试了很多次来解决这个问题,但我不能.

                While using h1-h6 tags in my html, i keep getting error messages on w3c validator. I'm new to this and I've tried so many times to solve the problem but i can't.

                文本在我的网站上看起来非常好,但无法验证.我该如何解决这个问题?错误信息如下;

                The text appears perfectly fine on my website but it won't validate. How do i solve this problem? The error message is as follows;

                第 34 行,第 4 列:文档类型不允许元素h1"这里;失踪对象"、小程序"、地图"之一,iframe"、按钮"、ins"、del"开始标签

                Line 34, Column 4: document type does not allow element "h1" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag

                <h1><span>我的网站</h1><span> <----这是我得到错误的代码.

                <h1><span> My website </h1>< span> <----this is the code i'm getting the error for.

                提到的元素是不允许的出现在上下文中你已经放置了它;另一个提到的元素是唯一的两者都允许在那里并且可以包含提到的元素.这可能意味着你需要一个包含元素,或者可能你忘记了关闭前一个元素.

                The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

                此消息的一个可能原因是您试图将块级元素(例如

                "或")放入内联元素(例如"、";"或").

                One possible cause for this message is that you have attempted to put a block-level element (such as "

                " or "") inside an inline element (such as "", "", or "").

                无论如何,使用标题标签的最佳方式是什么?我做错了什么?

                In any case what's the best way to use header tags? What am I doing wrong?

                推荐答案

                • span 是一个内联元素
                • h1 是块元素
                • 内联元素不能包含块元素
                • 元素不能部分被其他元素包含
                  • An span is an inline element
                  • An h1 is a block element
                  • An inline element cannot contain a block element
                  • Elements cannot be partially contained by other elements
                  • 因此,从DTD的角度来看:

                    Therefore, from the perspective of the DTD:

                    <h1><span>…</span></h1> <!-- This is fine -->
                    <div><h1>…</h1></div>   <!-- This is fine -->
                    <h1><span>…</h1></span> <!-- This is wrong -->
                    <span><h1>…</h1></span> <!-- This is wrong -->
                    

                    问题的正确解决方案实际上取决于您尝试使用 span 的目的.

                    What the right solution to the problem actually is rather depends on what you are trying to use the span for.

                    (请注意,上面对块和内联元素的讨论有些简化.请参阅 如何阅读 HTML DTD 以获得完整的故事,尤其是内容模型部分)

                    (Note that the discussion of block and inline elements above is somewhat simplified. See How to read the HTML DTD for the full story, in particular the section on the Content Model)

                    这篇关于h1 和跨度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                    本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                How can I stop a video with Javascript in Youtube?(如何在 Youtube 中停止使用 Javascript 的视频?)
                Embed YouTube video - Refused to display in a frame because it set #39;X-Frame-Options#39; to #39;SAMEORIGIN#39;(嵌入 YouTube 视频 - 拒绝显示在框架中,因为它将“X-Frame-Options设置为“SAMEORIGIN)
                How to get number of video views with YouTube API?(如何使用 YouTube API 获取视频观看次数?)
                Stop embedded youtube iframe?(停止嵌入 youtube iframe?)
                YouTube iframe player API - OnStateChange not firing(YouTube iframe 播放器 API - OnStateChange 未触发)
                YouTube iframe API: how do I control an iframe player that#39;s already in the HTML?(YouTube iframe API:如何控制 HTML 中已有的 iframe 播放器?)
                <i id='ggqQQ'><tr id='ggqQQ'><dt id='ggqQQ'><q id='ggqQQ'><span id='ggqQQ'><b id='ggqQQ'><form id='ggqQQ'><ins id='ggqQQ'></ins><ul id='ggqQQ'></ul><sub id='ggqQQ'></sub></form><legend id='ggqQQ'></legend><bdo id='ggqQQ'><pre id='ggqQQ'><center id='ggqQQ'></center></pre></bdo></b><th id='ggqQQ'></th></span></q></dt></tr></i><div id='ggqQQ'><tfoot id='ggqQQ'></tfoot><dl id='ggqQQ'><fieldset id='ggqQQ'></fieldset></dl></div>

                    <tfoot id='ggqQQ'></tfoot>
                  1. <legend id='ggqQQ'><style id='ggqQQ'><dir id='ggqQQ'><q id='ggqQQ'></q></dir></style></legend>

                      <bdo id='ggqQQ'></bdo><ul id='ggqQQ'></ul>
                        <tbody id='ggqQQ'></tbody>
                      • <small id='ggqQQ'></small><noframes id='ggqQQ'>