1.css:级联样式表2.用途:通俗说,用来美化html内容; 专业说,用来设置html内容的样式。
3.语法:
选择器{属性名:属性值;.......}4.css语言的引入
(1)行内样式表
<标记名 style="属性名:属性值;.......">(2)文档(内部)样式表
<style type="text/css">
选择器{属性名:属性值;.......
}
....
</style>(3)外部样式表
a.创建*.css文件
b.在其中定义css语句:选择器{属性名:属性值;.......}
....c.将css文件引入页面中:
<link rel="stylesheet" type="text/css" href=".../*.css">5.选择器
(1)标记选择器
标记名{}(2)id选择器
#id{}(3)类选择器
.class{}(4)通配符:*
选择该页面的所有元素(5)派生选择器
父标记 子标记{}(6)分组选择器
选择器1,选择器2,.......选择器n{}6.样式属性
(1)文字属性
font-size
font-family
font-weight
font-style
text-decoration
line-height
color(2)文本属性
text-indent
text-align(3)背景属性
background-color:
background-image:url()
background-attachment:fixed | scroll;
background-position
background-repeat:no-repeat | repeat | repeat-x | repeat-y;(4)边框属性
border-width
border-color
border-style
border:(5)尺寸属性
width
height(6)内边距(内补丁)属性
padding(7)外边距(外补丁)属性
margin(8)定位属性
position:fixed
top
left(9)列表属性
list-style-image : none | url (url)
list-style-type(10)伪类a{}:link
:visited
:hover
:active7.div span