简介; css Cascading Style Sheets 层叠化样式表
1.1嵌套属性
添加css的四种方式
① 直接添加在标识里面
内容
②头部文件里面添加
③链接样式表
④ 联合使用样式表
css选择器
所有的HTML语言中的标记都是通过不同的css选择器进行控制的.
body{ background-image:url(“./timg.jpg”); –定义背景图片
background-position:center;}
p { –定义p段落的背景颜色
background-color:#00ffff }
1.2 文本编辑
#p1 {
text-align:left;–左边距
text-indent:5em;–缩进
background-color:red;–背景色
word-spacing:30px;-字节间距
letter-spacing:10px; –字母间距
text-decoration:underline–下划线
This is my content
1.3 css字体
#p1 {
font-family:sans-serif;
font-weight:100;
font-size:16px;
1.4 边框
content– padding–border–margin
border-style:solid –边框样式
border-left-color:green –边框颜色
margin:20px 30px 20px 30px 外边距设置
内边距
padding 定义元素的内边距
padding-left:10%
1.5列表
列表分为有序列表和无序列表,可以使用 list-style-type 来设置前面的标志
- 脉动
- 绿茶
属性–详细参考chm文档
list-style-position
list-style-image