Will whitespace or wrap be ignored between two block elements in HTML?

前端 未结 2 1144
离开以前
离开以前 2020-12-22 06:14

Intuitively, the space or wrap will be ignored between two block tag though we code it with the space. As follow figure:

<         


        
2条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-22 07:03

    Any whitespace between block level elements is ignored so you can lay out the markup in a way which makes it easy to read. If this wasn't the case your entire document would probably be on two or three lines.

    You can add in line-breaks with the
    tag or add whitespace with margin or padding. Remember, HTML just defines the content of the document: it doesn't care how it is rendered. That is what CSS is for.

提交回复
热议问题