There are many block elements. Here we will introduce two very simple and commonly used ones:
div: also called block element, without any style, is used to divide the page. Ribbon.
span: Also called inline element, it also has no style and is usually used as a container for label content.
So the question is?
What? Is it a block element? It automatically occupies a line, which is equivalent to adding a carriage return
at the end of the element.
The characteristic is that the width and height can be set, so it is very suitable for page layout
What Is it an inline element? All inline elements are displayed in one line. If the line cannot be displayed, the line will break, so it is also called an inline element, because it is naturally used to display the content of the web page, so the width and height cannot be set. Its width and height are determined by its internal elements, such as text,
images, form controls, etc. Of course, it does not need to set the width and height.
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>2.区块</title> </head> <body> <div> <span>今天是个好天气</span><img src="../images/10.png" height="200"> </div> </body> </html>
The above is the detailed content of html block element. For more information, please follow other related articles on the PHP Chinese website!