代码之家  ›  专栏  ›  技术社区  ›  Flegy

H1标签特殊设计

  •  -3
  • Flegy  · 技术社区  · 7 年前

    所以我的问题是,,

    我怎样才能使H1标记没有任何效果,只是在HTML中成为一个普通标记,而不会对文本产生样式影响?

    3 回复  |  直到 7 年前
        1
  •  4
  •   לבני מלכה    7 年前

    使用 all: unset; 删除默认浏览器样式(如果需要,可以设置样式…)

    h1{
     all: unset;
    }
    <h1>I am h1 but looks like normal p</h1>

    IE中的编辑支持

    !important

    here is links to default style in each browser

    例如,覆盖IE样式:

    h1{
    font-size: 11pt;
    font-weight: normal;
    }
     <h1>I am h1 but looks like normal p</h1>
     
     <p>this is the default style:</p>
     display: block;
    font-size: 24pt;
    font-weight: bold;
    margin: 14pt 0;
        2
  •  0
  •   Joyson    7 年前

    按照为其他标记声明的方式重新指定h1标记样式。 h1{font-size:20px !important;.....}

        3
  •  0
  •   Sarabjit Singh    7 年前

    您可以使用h1标记作为主要标题,并根据您的需求进行自定义。比如:-

    h1{font-size: 24px;}