What is HTML's tag default display type?

后端 未结 2 427
别跟我提以往
别跟我提以往 2020-12-05 23:11

I haven\'t been able to find anything that says what the default display is equivalent to in CSS\'s display properties. I ask, because whenever I attempt to add padding or m

相关标签:
2条回答
  • 2020-12-05 23:55

    It is always display: inline by default. Horizontal margins, and padding on all sides should work without having to change its display property.

    This remains true even in HTML5. If you are applying styles to an <a> element that contains flow elements or any other elements that are represented in CSS as display: block, you should set the <a> itself to a proper block container type such as block or inline-block for its layout to work as intended.

    0 讨论(0)
  • 2020-12-06 00:08

    It's INLINE by default. Inline-block is not supported in IE7.

    margin is not supported in Inline element. and only left & right padding is supported in INLINE element.

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