批改状态:合格
                        老师批语:
                    
                            .前言:
做了二年前端了,但也是会一点基本东西,php不是很懂,想借助php中文网提升自己,未来全栈可能是趋势。
<!DOCTYPE html><!-- xml xhtml 声明 -->
<html>
<head>
<!-- 头部标题 -->
<title>php中文网——视频教程</title>
<!-- 字符集编码 -->
<meta charset="utf-8">
<!-- //连接外部样式 -->
<link rel="stylesheet" type="text/css" href="style/style.css">
<!-- 内部样式书写 -->
<style type="text/css">
 .box{
    width:100px;
    height:100px;
    background:green;
 }
 #main{
    width:100px;
    height:100px;
    background:blue;
 }
/* 标签选择器 */
a{
    color:blue;
}
 /*派生选择器 根据文档上下文关系来定义样式*/
a[href="http://www.baidu.com"]{
    color: #f30;
}
</style>
</head>
<body> <!-- <body style="background:#f30;">  标签样式表 -->
<a href="http://www.baidu.com"> 百度一下 </a><br>
<a href="http://www.php.cn">php中文网 </a>
<div class="box">  <!-- 定义类 -->
     <a href="www.baidu.com"> </a>
 </div>
<div id="main">  </div>   <!-- 定义id -->
</body>
<html>点击 "运行实例" 按钮查看在线实例
.手写代码:


上述代码知识点总结:
1、css选择器的优先权:标签>id>class
2、css样式的几种使用方法:标签样式、内部样式、外部样式
3、属性选择器是以html的属性来设定
                Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号