批改状态:合格
                        老师批语:作业日期下次记得带上!这个日期是课程日期
                    
                            
            
        8.10是跟着php网络班第一次学习,下面是作业内容
代码:
<!DOCTYPE html>  <!-- 声明 html xml -->
<html>
<head>		<!-- 定义网页头部 -->
	<title>PHP</title>
	<meta charset="utf-8">
	<link rel="stylesheet" type="text/css" href=".css">  <!-- rel属性:定义当前文档和被链接文档的关系,type属性:定义链接文档类型,href:定义被连接文档地址 --> <!-- 外部样式:为了共享 -->
	<link rel="shorcut icon" type="images/x-icon" href="images/icon.png">
	<script type="text/javascript" src=".js"></script>
	<style type="text/css">  /*内部样式:只针对当前页面*/
		/*tag标签:id名(名字前面加 #)、class名(名字前面加.)、 属性选择器*/
		body{background:red;}
		#box{width: 100px;height: 100px;background: red} /*id选择器*/
		.main{width: 100px;height: 100px;background: green} /*class选择器 类*/
		a{color: pink}
		a[href="https://www.baidu.com"]{color: black}
		a[href="http://www.php.cn"]{color: black}
		div a{color: black} #box a{}
	</style>
</head>
<body style="background:white;"> <!-- 内联样式:优先级高于内部样式 -->
	<img src="">
	<a href="https://www.baidu.com">baidu</a>
	<a href="http://www.php.cn">php.cn</a>
	<a href="ceshi.html">ceshi</a>
	<a href="#">#</a>
	<div id="box">
		<a href="">123</a>
	</div>
	<div class="main"></div>
	<div></div>
	<div></div>
</body>
</html>点击 "运行实例" 按钮查看在线实例
总结:
html的结构:
<!document html> 头部声明
<html> html
<head></head> 头部
<body></body> 内容部分
</html> html结束符号
样式权限:行内/内联 > 内部样式 >外部样式;
第一次见到用href当元素设置属性值,学到了

                Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号