Are H1,H2,H3,H4 tags block or inline elements?

后端 未结 7 930
暗喜
暗喜 2020-12-06 08:52

Is it correct HTML to change the color of text inside a H1, H2, H3 or H4 element? Are they block level?

For example

相关标签:
7条回答
  • 2020-12-06 09:54

    Yes This is the correct way, If you want to use inline css. Otherwise make a class say

    <h1 class="title"><span>#500</span> Hello world</h1>
    

    Now Its Css is:

    h1.title span{
    color:#ABABAB;
    }
    

    Again yes h1 to h6 is a block level.

    0 讨论(0)
提交回复
热议问题