Blogger Information
Blog 30
fans 0
comment 0
visits 22587
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
CSS语法
的确
Original
911 people have browsed it

SS语法规则由两个部分构成:选择器,以及一条或多条声明:

选择器通常是需要改变样式的HTML元素,每条声明由一个属性和一个值组成

属性是希望设置的样式属性。每个属性有一个值,属性和值被冒号分开

CSS声明总是以分号(;)借结束,声明组以大括号({})括起来

实例:

P{color:red;text-align:center;}

为了让CSS可读性更强,可以每行只描述一个属性

实例:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf8" />
<title>118qq.top</title>
<style type="text/css">
p{
       color:red;       
       text-align:center;
       }
</style>
</head>
<body>
<p>这是一个段落</p>
<p>这又是一个段落</p>
</body>
</html>

CSS注释

注释是用来注释你的代码,并且可以随意编辑它,浏览器会忽略它

CSS注释一“/*”开始,以“*/”结束

实例:

p{
       color:red;
       text-align:center; /* 这是一个注释 */
       }
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