search
  • Sign In
  • Sign Up
Password reset successful

Follow the proiects vou are interested in andi aet the latestnews about them taster

HTML basic tutorial block elements and line elements

Block elements

  • Block elements usually occupy one line by themselves. Regardless of the content, they always occupy one line.

  • What are the block elements? <div>, <p>, <h1>, <h2>, <pre>, etc.

#Inline elements

  • Inline elements will not occupy a separate line.

  • The width of inline elements is mainly determined based on the content.

  • Multiple inline elements will be arranged on the same line.

  • What are the inline elements? <font>, <b>, <i>, <u>, <sub>, <sup>, etc.

##Conclusion: In the tag embedded When nested, it is usually inline elements nested within block elements.

You should pay attention to this when typesetting. Multiple inline elements will be arranged in one line. If you want to break a line, you must use a line break tag, and a block element occupies a separate line

new file
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>这是我们的第一个页面</title> </head> <body> <h1>欢迎加入php.cn</h1> <h2>希望你能够在这里学的开心</h2> </body> </html>
Reset Code
Automatic operation
submit
Preview Clear