Blogger Information
Blog 22
fans 0
comment 0
visits 21763
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
8月10日作业:初步认识HTML和css
岑勋的博客
Original
624 people have browsed it

第一天上课,补充了解了meta标签、rel属性和css中的属性选择器。这是自己敲的

代码练习

实例

<!DOCTYPE html>
<html>
<head>
	<title>小牛之家</title>
	<!-- meta标签指定网页的描述内容、关键字、字符编码等 -->
	<meta charset="utf-8">  
	<!-- link标签引入外部文件。其中rel属性规定当前文档与被链接文档之间的关系。在下面第一个例子中,rel 属性在网页标签栏左侧显示图标。 -->
	<link rel="shortcut icon" type="image/x-icon" href="favicon.ico"> 
	<!-- 此处rel属性表明被链接文档是样式表,href属性指定URL -->
	<link rel="sheetstyle" type="text/css" href="style.css">
	<!-- 内部样式表 -->
	<style type="text/css">
		/*设置a标签样式*/
		a{
			text-decoration:none;
			display: block;
		}
		
		a[href='http://www.php.cn']{color:red;}
		a:hover{
			color:blue;
		}
		div{
			border: 2px solid gray;
			width:100px;
			height: 100px;
			float: left;
		}
		/*分别设置类名为box,id为big的div元素的样式*/
		div.box{
			background: lightgreen;
		}
		div#big{
			width: 200px;
			background: pink;
		}

	</style>

</head>
<body>
	<a href="http://www.php.cn">php中文网</a>
	<a href="http://www.baidu.com">百度</a>
	<div >
		<p>来PHP中文网学习</p>
	</div>
	<div ></div>
	<div id="big"></div>
	<div class="box"></div>
	<div class="box"></div>
	<div class="box"></div>
</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

QQ截图20180813171341.png


Correction status:qualified

Teacher's comments:
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