外联:<link rel="stylesheet" href=""> 外部引入
内部:<style type="test/css"></style>
内联:<div style="color">
元素选择器:div{}
id选择器: #test{}
类选择器: .test1{}
包含选择器: div span{} div.span{} div > span{}
文本溢出:
z-index:
postion: fixed static absolute relative
导航条 float:left right
------------------------------------------------
css的几种写法
第一种 通过外部引入css文件 作用范围最广 适用于所有的页面 只要引入即可
<link rel="stylesheet" href="style.css">
第二种 内部样式 作用范围 只在当前页面有效
<style type="text/css"></style>
第三种 内联样式 在元素标签中 写style属性 作用范围最小 只作用于当前元素
<p style="color:red;"></p>
基本规则
选择器名{属性名:属性值; }
选择器:
元素选择器 元素名{name:value;}
类选择器 .test{name:value;}
id选择器 #test{name:value; }
选择器混合使用
p.test{name:value;}
p .test{name:value;}
p > .test{name:value;}
定位:
是个定位
相对定位:relative
绝对定位:absolute
默认定位:static
固定定位:fixed
布局:
float
clear
盒子模型:
margin:外边据
border:边框
padding:内编剧