How to prevent headings (

) from taking up more width than they need?

后端 未结 4 877
长发绾君心
长发绾君心 2020-12-29 20:30

If I define a heading like

, its width is set to 100% by default.

Is there a way to make sure its width is set to the smallest value possible

4条回答
  •  醉梦人生
    2020-12-29 20:48

    It's a block level element, so it follows the rules of display:block. You can set display:inline, which may do what you need or not, depending on the context.

提交回复
热议问题