1. 颜色的表示方法:
- blue;
- #FF0000;
- rgb(255, 0, 0);
- rgba(255, 0, 0, 0.5),第四个值取值范围为0-1,0是完全透明,1是完全不透明;
- hsl(360, 100%, 50%),色相、饱和度、亮度;
- hsla(360, 100%, 50%, 0.5),多了个透明度。
2. 文档样式化的三种技术:
- Inline Style:内联(行内)样式。
<h1 style="color: red">
- Intrenal Style:内部样式。就是在<head>的<title>后面跟着一个<style>,然后把css放在里面。
<title>Selector Basics</title>
<style type="text/css">
p {
color: #5f9794;
font-family: "Century Gothic", "Gill Sans", Arial, sans-serif;
font-size: 1em;
margin-left: 50px;
}
</style>
- External Style:外部样式。就是把所有的css定义在另一个文件里,然后通过链接的方法使用它。
<title>Selector Basics</title>
<link rel="stylesheet" type="text/css" href="global.css">
</head>