html block element

无忌哥哥
Release: 2018-06-29 10:13:17
Original
2555 people have browsed it

There are many block elements. Here we will introduce two very simple and commonly used ones:

and

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>
Copy after login

The above is the detailed content of html block element. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template