Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/77.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 同级标题但不同类别_Html_Semantic Markup_Html Heading - Fatal编程技术网

Html 同级标题但不同类别

Html 同级标题但不同类别,html,semantic-markup,html-heading,Html,Semantic Markup,Html Heading,假设有一个主标题,它有几个子标题,这些子标题可以通过给它们单独的标题进行分类,但是它们在视觉上的传达方式不同于给它们单独的标题 i、 e: 在这种情况下,我们应该如何使用标题标签? 我认为应该(但不确定)为这两个类别添加单独的部分元素 像这样: 有什么建议吗?从纯技术搜索引擎优化的角度来看,如果两个部分都有自己的标题,并且这些部分的内容都有自己的副标题,那就更好了,所以您应该寻找类似这样的内容: <main> <h1>Your Company Name<

假设有一个主标题,它有几个子标题,这些子标题可以通过给它们单独的标题进行分类,但是它们在视觉上的传达方式不同于给它们单独的标题

i、 e:

在这种情况下,我们应该如何使用标题标签?

我认为应该(但不确定)为这两个类别添加单独的
部分
元素

像这样:


有什么建议吗?

从纯技术搜索引擎优化的角度来看,如果两个部分都有自己的标题,并且这些部分的内容都有自己的副标题,那就更好了,所以您应该寻找类似这样的内容:

<main>
    <h1>Your Company Name</h1>
    <section>
            <header>
                    <h2>About Us</h2>
                    <h3><a href="#what_we_do">What we do</a></h3>
                    <h3><a href="#where_we_are">Where we are</a></h3>
                    <h3><a href="#where_we_do">Where we do</a></h3>
            </header>
            <section id="what_we_do"><p>Lorem Ipsum Dolor Sit Amet...</section>
            <section id="where_we_are"><p>Lorem Ipsum Dolor Sit Amet...</section>
            <section id="where_we_do"><p>Lorem Ipsum Dolor Sit Amet...</section>
    </section>
    <section>
            <header>
                    <h2>About Us</h2>
                    <h3><a href="#what_we_do">What we do</a></h3>
                    <h3><a href="#where_we_are">Where we are</a></h3>
                    <h3><a href="#where_we_do">Where we do</a></h3>
            </header>
            <section id="what_we_do"><p>Lorem Ipsum Dolor Sit Amet...</section>
            <section id="where_we_are"><p>Lorem Ipsum Dolor Sit Amet...</section>
            <section id="where_we_do"><p>Lorem Ipsum Dolor Sit Amet Dolor...</section>
    </section>
</main>

你的公司名称
关于我们
我爱你,我爱你。。。
我爱你,我爱你。。。
我爱你,我爱你。。。
关于我们
我爱你,我爱你。。。
我爱你,我爱你。。。
我爱你,我爱你。。。
通常我喜欢做的是在没有任何CSS/JavaScript的情况下查看页面,并查看它的外观。如果您有相同的流程,并且在默认情况下事情看起来应该是这样的,那么您就走上了正确的轨道。 搜索引擎足够聪明,能够理解您的意思,即使您对所有内容都使用div,但在语义上正确的搜索引擎可能会增加它们与您整洁有序的代码的相似性


为两者添加部分可能会有所帮助,但更有用的是,本页讨论的是一个特定主题,而不是多个主题。因此,我建议您为每个人制作一个关于我们和属性的页面。如果这看起来有些过分,你可以只看一页;这是正确的,但在搜索引擎眼中并不是最优的——他们真的很喜欢每个主题都有一个页面,并且它们在域内是唯一的。

从纯技术SEO的角度来看,如果两个部分都有自己的标题,并且这些部分的内容都有自己的副标题,那就更好了,因此,您将寻找类似以下内容:

<main>
    <h1>Your Company Name</h1>
    <section>
            <header>
                    <h2>About Us</h2>
                    <h3><a href="#what_we_do">What we do</a></h3>
                    <h3><a href="#where_we_are">Where we are</a></h3>
                    <h3><a href="#where_we_do">Where we do</a></h3>
            </header>
            <section id="what_we_do"><p>Lorem Ipsum Dolor Sit Amet...</section>
            <section id="where_we_are"><p>Lorem Ipsum Dolor Sit Amet...</section>
            <section id="where_we_do"><p>Lorem Ipsum Dolor Sit Amet...</section>
    </section>
    <section>
            <header>
                    <h2>About Us</h2>
                    <h3><a href="#what_we_do">What we do</a></h3>
                    <h3><a href="#where_we_are">Where we are</a></h3>
                    <h3><a href="#where_we_do">Where we do</a></h3>
            </header>
            <section id="what_we_do"><p>Lorem Ipsum Dolor Sit Amet...</section>
            <section id="where_we_are"><p>Lorem Ipsum Dolor Sit Amet...</section>
            <section id="where_we_do"><p>Lorem Ipsum Dolor Sit Amet Dolor...</section>
    </section>
</main>

你的公司名称
关于我们
我爱你,我爱你。。。
我爱你,我爱你。。。
我爱你,我爱你。。。
关于我们
我爱你,我爱你。。。
我爱你,我爱你。。。
我爱你,我爱你。。。
通常我喜欢做的是在没有任何CSS/JavaScript的情况下查看页面,并查看它的外观。如果您有相同的流程,并且在默认情况下事情看起来应该是这样的,那么您就走上了正确的轨道。 搜索引擎足够聪明,能够理解您的意思,即使您对所有内容都使用div,但在语义上正确的搜索引擎可能会增加它们与您整洁有序的代码的相似性


为两者添加部分可能会有所帮助,但更有用的是,本页讨论的是一个特定主题,而不是多个主题。因此,我建议您为每个人制作一个关于我们和属性的页面。如果这看起来有些过分,你可以只看一页;这是正确的,但在搜索引擎眼中并不是最优的——他们真的希望每个主题都有一个页面,并且它们在域中是唯一的。

请注意,
section
元素是一个section content元素。这意味着它会在文档大纲中创建一个条目。如果您想根据大纲中相应的等级使用
h1
-
h6
,您的
h2
标题应该变成
h3
标题

还请注意,建议在适当的情况下明确使用节内容元素(例如,至少在使用标题元素的任何地方),因此您可能也希望在“我们做什么”等方面使用
section

因此,与大纲相关的结构可以如下所示:

<main>
    <h1>Your Company Name</h1>
    <section>
            <header>
                    <h2>About Us</h2>
                    <h3><a href="#what_we_do">What we do</a></h3>
                    <h3><a href="#where_we_are">Where we are</a></h3>
                    <h3><a href="#where_we_do">Where we do</a></h3>
            </header>
            <section id="what_we_do"><p>Lorem Ipsum Dolor Sit Amet...</section>
            <section id="where_we_are"><p>Lorem Ipsum Dolor Sit Amet...</section>
            <section id="where_we_do"><p>Lorem Ipsum Dolor Sit Amet...</section>
    </section>
    <section>
            <header>
                    <h2>About Us</h2>
                    <h3><a href="#what_we_do">What we do</a></h3>
                    <h3><a href="#where_we_are">Where we are</a></h3>
                    <h3><a href="#where_we_do">Where we do</a></h3>
            </header>
            <section id="what_we_do"><p>Lorem Ipsum Dolor Sit Amet...</section>
            <section id="where_we_are"><p>Lorem Ipsum Dolor Sit Amet...</section>
            <section id="where_we_do"><p>Lorem Ipsum Dolor Sit Amet Dolor...</section>
    </section>
</main>

Xyz公司
关于我们
我们所做的
我们在哪里?
我们在哪里?
属性
尊重
责任
生长
每个节内容元素(以及每个节根元素,即本例中的
body
)都有自己的标题,没有明确的节就没有标题


即使您不想提供“关于我们”和“属性”标题,您仍然可以保留这两个
部分
元素。不理想,但总比没有好,因为它们使预期的文档大纲更清晰。(一种折衷方法是用CSS在视觉上隐藏这两个标题。)

请注意,
元素是一个节内容元素。这意味着它会在文档大纲中创建一个条目。如果您想根据大纲中相应的等级使用
h1
-
h6
,您的
h2
标题应该变成
h3
标题

还请注意,建议在适当的情况下明确使用节内容元素(例如,至少在使用标题元素的任何地方),因此您可能也希望在“我们做什么”等方面使用
section

因此,与大纲相关的结构可以如下所示:

<main>
    <h1>Your Company Name</h1>
    <section>
            <header>
                    <h2>About Us</h2>
                    <h3><a href="#what_we_do">What we do</a></h3>
                    <h3><a href="#where_we_are">Where we are</a></h3>
                    <h3><a href="#where_we_do">Where we do</a></h3>
            </header>
            <section id="what_we_do"><p>Lorem Ipsum Dolor Sit Amet...</section>
            <section id="where_we_are"><p>Lorem Ipsum Dolor Sit Amet...</section>
            <section id="where_we_do"><p>Lorem Ipsum Dolor Sit Amet...</section>
    </section>
    <section>
            <header>
                    <h2>About Us</h2>
                    <h3><a href="#what_we_do">What we do</a></h3>
                    <h3><a href="#where_we_are">Where we are</a></h3>
                    <h3><a href="#where_we_do">Where we do</a></h3>
            </header>
            <section id="what_we_do"><p>Lorem Ipsum Dolor Sit Amet...</section>
            <section id="where_we_are"><p>Lorem Ipsum Dolor Sit Amet...</section>
            <section id="where_we_do"><p>Lorem Ipsum Dolor Sit Amet Dolor...</section>
    </section>
</main>

Xyz公司
关于我们
我们所做的
我们在哪里?
我们在哪里?
属性
尊重
责任
生长
每个分段内容元素(