Blogger Information
Blog 8
fans 0
comment 0
visits 3603
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
HTML基本标签样式,以及类选择器的使用2018-8-14
Kamil的博客
Original
543 people have browsed it

1.实例代码如下


实例

<!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> 定义内部样式


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post