链接方法:
外部链接样表:<head><link rel="stylesheet" type="text/css" href="*.css"></head>
内部的:1:<head><style type="text/css"> example css </style></head>
2:<p style="color: sienna; margin-left: 20px">
使用方法:
类选择器:.center {text-align: center}
<h1 class="center"
>
This heading will be center-aligned
</h1>
id选择器:#center {text-align: center}
<h1 id="center"
>
This heading will be center-aligned
</h1>
派生:
基于大类的使用,只要更大的元素内部的表格单元: .fancy td
类名为 fancy 的表格单元: td.fancy <td class="fancy"
>
background-position 的默认值是 0% 0%,在功能上相当于 top left。
background-attachment:fixed:图像固定不动
body
{
background-image:url(/i/eg_bg_02.gif);
background-repeat:no-repeat;
background-attachment:fixed
}
background | 简写属性,作用是将背景属性设置在一个声明中。 |
background-attachment | 背景图像是否固定或者随着页面的其余部分滚动。 |
background-color | 设置元素的背景颜色。 |
background-image | 把图像设置为背景。 |
background-position | 设置背景图像的起始位置。 |
background-repeat | 设置背景图像是否及如何重复。 |
text-align 属性
h1 {text-align:center
}
h2 {text-align:left
}
h3 {text-align:right
}