Difference between HTML Block Elements and CSS Display Block Properties

May I know whether there is any difference between the block elements of HTML (eg. <p>, <div>...) and CSS property display: block?

Since from what I read, they are the same, but why do we still need to use display: blockblock level for some element.

+4
source share
2 answers

What you call “HTML block elements” are elements that have their display property set to block, so there is no difference between a <div>and <span>c display:block;.

(.. ). chrome dev " ".

, display:block; div:

  • obscur, - ( ).
  • CSS, display:none;
+3

... css display: block.

display: block, , / display: none.

+1

All Articles