为什么截面元素内 H1 的大小不同? [英] Why is size of H1 different inside a section element?

查看:35
本文介绍了为什么截面元素内 H1 的大小不同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即使是 HTML,我也是 HTML5 的新手.我的困惑是关于 HTML 代码使用的标题,这是我的代码片段:

I'm the very new beginner at HTML5 even in HTML. My confuse is about the heading which is used by HTML code, this is my code snippet:

<body>
  <header>
    <h1>Text A</h1> 
  </header>

  <section>
    <h1>Text B</h1>
    <article>
      <header>
        <hgroup>
          <h1>Text C</h1>
          <h2>Text C2</h2>
        </hgroup>
       </header>

好的,让我们进入正题,我的问题是;

Okay let's get to the topic, my question is;

  1. 部分的
    内的标题远大于
    部分内的

    ,该部分内的

    远大于
    部分的
    内的

    .换句话说:文本 A > 文本 B > 文本 C,即使它们使用相同的标题.

  1. the <h1> heading inside the <header> of the <body> part much bigger than <h1> inside the <section> part which is much bigger than <h1> inside the <article> of the <section> part. In other words : Text A > Text B > Text C, eventhough they're using the same heading.

为什么文本 C2 比文本 C 大得多,即使文本 C2 使用

而文本 C 使用

并且它们位于同一位置?

why the Text C2 much bigger than Text C eventhough Text C2 using <h2> while Text C using <h1> and they are on the same location?

这是某种错误吗?顺便说一下,我使用 Firefox 浏览器.提前致谢.

Is it some kind of bugs? I use the Firefox browser, by the way. Thanks in advance.

推荐答案

JSFiddle.H1>

这只是关于 DOM 结构.

因为不同的元素有不同的默认样式可以继承.
链接形成 MDN.

<h1>Text A</h1>

<header>
     <h1>Text A</h1> 
</header>
<section>
    <header>
         <h1>Text A</h1>

    </header>
</section>
<article>
    <header>
         <h1>Text A</h1>
          <section>
              <header>
                  <h1>Text A</h1>
              </header>
          </section>
    </header>
</article>

这篇关于为什么截面元素内 H1 的大小不同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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