
鱼C课程案例库:https://ilovefishc.com/html5/ html5速查手册:https://man.ilovefishc.com/html5/ css速查手册:https://man.ilovefishc.com/css3/
span标签:https://man.ilovefishc.com/pageHTML5/span.html br标签:https://man.ilovefishc.com/pageHTML5/br.html 我们发现,有的标签在一行里显示,有的标签会另起一行:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>第九节课</title>
<meta name="viewport" content="width=device-width, intial-scale=1.0">
<meta name="keywords" content="小甲鱼,Web开发,HTML5,CSS3,Web编程教学">
<meta name="description" content="《零基础入门学习Web开发》案例演示">
<meta name="author" content="小甲鱼">
</head>
<body>
<a href="http://bbs.fishc.com">论坛</a>
<a href="fishc.taobao.com">淘宝</a>
<p>茕茕孑立</p>
<p>形单影只</p>
</body>
</html>
这涉及到“块级元素”和“行内元素”。


span标签没有特定的样式。只有对它设置样式的时候,才会产生视觉上的表现。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>第九节课</title>
<meta name="viewport" content="width=device-width, intial-scale=1.0">
<meta name="keywords" content="小甲鱼,Web开发,HTML5,CSS3,Web编程教学">
<meta name="description" content="《零基础入门学习Web开发》案例演示">
<meta name="author" content="小甲鱼">
<style>
span {color: red}
</style>
</head>
<body>
<a href="http://bbs.fishc.com">论坛</a>
<a href="fishc.taobao.com">淘宝</a>
<p>茕茕<span>孑立</span></p>
<p>形单<span>影只</span></p>
</body>
</html>
br标签用于插入一个简单的换行符。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>第九节课</title>
<meta name="viewport" content="width=device-width, intial-scale=1.0">
<meta name="keywords" content="小甲鱼,Web开发,HTML5,CSS3,Web编程教学">
<meta name="description" content="《零基础入门学习Web开发》案例演示">
<meta name="author" content="小甲鱼">
<style>
span {color: red}
</style>
</head>
<body>
<a href="http://bbs.fishc.com">论坛</a>
<a href="fishc.taobao.com">淘宝</a>
<p>茕茕<span><br>孑立</span></p>
<p>形单<span>影只</span></p>
</body>
</html>
行内元素和块级元素的对比: