<!DOCTYPE html>
<html>
<head>
	<title>小C商城</title>
	<meta charset="utf-8">
	<link rel="stylesheet" type="text/css" href="/Users/kamil/Desktop/htmlStudy/test.css"><!-- 此css可共享-->
	<link rel="shortcut icon" type="img/x-icon" href="/Users/kamil/Desktop/htmlStudy/xiaomilogo.png"><!--引入资源-->
	<style type="text/css">/*这里定义样式*/
		body{
		}
		a{
			color: red;
		}
		#box{width: 100px;height: 100px;background: blue;}
		.main{width: :100px;height: 100px;background: green;}
		a[href="https://www.google.com"]{color: blue;}
		a[href="http://www.php.cn"]{color: black;}
		div a{color: #ccc;};
		/*这里通过class ID 选择器来控制样式,以及子标签的样式*/
	</style>
</head>
<body>
	<img src="/Users/kamil/Desktop/htmlStudy/show.png">
	<a href="https://www.google.com">google</a>
	<a href="http://www.php.cn">php</a>
	<a href="/Users/kamil/Desktop/htmlStudy/testhtml.html">本地文件</a>
	<div id="box">
		<a href="">show message</a>
	</div>
	<div class="main"></div>
</body>
</html>点击 "运行实例" 按钮查看在线实例
2.个标签含义
<a> 定义超链接
<div> 定义区块
<img> 定义图片
<title> 定义网页文档标题
<link>链接外部文件
<style> 定义内部样式
                Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号