Basic syntax of block elements
1. Html block elements. Block elements usually start with a new line at the beginning, such as h1, p, ul
2 .Inline elements usually do not start with a new line, such as a, b, img
3.html p element, p is also called a block element, which is mainly used as a container for combining html elements
4.html span element, the span element is an inline element and can be used as a container for text
! ! ! ! ! ! Code example
<!DOCTYPE html><html lang="en"><head>
<meta charset="UTF-8">
<title>H5块元素</title>
<link rel="stylesheet" type="text/css" href="myStyle.css">
<style>
span{ color:chartreuse; }
</style></head><body>
<p>这是一个段落</p>
<h1>这是一个标题</h1>
<b>这是一个加重</b>
<a>这是一个超链接</a>
<p id="pId">
<p>
这是一个段落 </p>
<a>这是一个超链接</a>
</p>
<p>
<P><span>这是一个span测试,</span>测试效果</P>
</p></body></html>
Copy after login
Copy after login
css code
#pId p{ color:red;}
Copy after login
Copy after login
pId is the id of di, and the following p is the specified P tag
Rendering
Basic syntax of block elements
1. Html block elements. Block elements usually start with a new line at the beginning, such as h1, p, ul
2. Inline elements usually do not start with a new line, such as a, b, img
3.html p element, p is also called a block element, which is mainly used as a container for combining html elements
4.html span element, span element is an inline element and can be used as a container for text
! ! ! ! ! ! Code example
<!DOCTYPE html><html lang="en"><head>
<meta charset="UTF-8">
<title>H5块元素</title>
<link rel="stylesheet" type="text/css" href="myStyle.css">
<style>
span{ color:chartreuse; }
</style></head><body>
<p>这是一个段落</p>
<h1>这是一个标题</h1>
<b>这是一个加重</b>
<a>这是一个超链接</a>
<p id="pId">
<p>
这是一个段落 </p>
<a>这是一个超链接</a>
</p>
<p>
<P><span>这是一个span测试,</span>测试效果</P>
</p></body></html>
Copy after login
Copy after login
css code
#pId p{ color:red;}
Copy after login
Copy after login
pId is the id of di, and the following p is the specified P tag
Rendering
The above is the content of the H5 learning journey - the use of H5 block tags (9). For more related content, please pay attention to the PHP Chinese website (m.sbmmt.com)!