Blogger Information
Blog 13
fans 0
comment 0
visits 6648
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
html标签+css选择器的使用--2018年11月11日20时31分作业
七分钟的记忆的博客
Original
635 people have browsed it

.前言:

做了二年前端了,但也是会一点基本东西,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>

运行实例 »

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

.手写代码:

IMG20180811202533.jpg

IMG20180811202558.jpg


上述代码知识点总结:

1、css选择器的优先权:标签>id>class   

2、css样式的几种使用方法:标签样式、内部样式、外部样式 

3、属性选择器是以html的属性来设定

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!