What are the default CSS styling of heading tags? (H1, h2, h3, h4, h5)

前端 未结 4 1645
小蘑菇
小蘑菇 2021-02-07 08:49

In HTML, headings are denoted with (1,2,3,4,5,6) tag.

My question is regarding following HTML code:

4条回答
  •  庸人自扰
    2021-02-07 09:31

    Are there predefined property for same in CSS; which gives same look and feel as H gives?

    No.

    The default style of a heading is (in most browsers) exactly that: a collection of different CSS rules coupled with an Hn selector (and stored in the browser stylesheet).

    There isn't a (plain CSS) way to automatically copy all of those rules.

    You could use the Inspector tool that comes in the developer tools built into most browsers to examine a heading and look at the default rules for it, and then copy those rules to your own (author) stylesheet.

    There may be some variations between browsers, so you'll generally want to set the Hn rules explicitly too.

提交回复
热议问题