p:first-letter {
font-size: 3em;
float: left;
}
p:first-line {
font-weight: bold;
}
blockquote:before {
content: open-quote;
}
blockquote:after {
content: close-quote;
}
li:before {
content: “POW: “
}
p:before {
content: url(images/jam.jpg)
}
@media print {
body {
font-size: 10pt;
font-family: times new roman, times, serif;
}
#navigation {
display: none;
}
}
@font-face {
font-family: somerandomfontname;
src: url(somefont.eot);
font-weight: bold;
}
p {
font-family: somerandomfontname;
font-weight: bold;
}
@page {
size: 15cm 20cm;
margin: 3cm;
marks: cross;
}
h1 {
display: inline;
font-size: 2em;
}
#header p {
display: inline;
font-size: 0.9em;
padding-left: 2em;
}
#navigation, #seeAlso, #comments, #standards {
display: none;
}
body {
background: white url(//images.sj33.cn/uploads/allimg/200803/20080309225852658.gif) no-repeat top right;
}
background-color出現(xiàn)在前面。
background-image圖片的位置。
background-repeat圖片重復(fù)的形式。背景圖片可以重復(fù)repeat(這就像建筑用的瓦片一樣),repeat-x在x軸(左右)重復(fù),repeat-y在y軸(上下)重復(fù),no-repeat不重復(fù)只顯示一個。
background-position可以使用top,center,bottom,left,right或任何可以看到的組合,比如above在上面。
可以為大部分html元素設(shè)置背景圖片,不只是整個頁面(body),可以用來制作簡單但效果顯著的美化,比如圓角等等不同的邊角形狀。
p {
border-top-width: 1px;
border-right-width: 5px;
border-bottom-width: 10px;
border-left-width: 20px;
}
p {
border-width: 1px 5px 10px 20px;
}
p {
border: 1px red solid;
}
p {
font: italic bold 1em/1.5 courier;
}
p {
font: 1em/1.5 “Times New Roman”, times, serif;
padding: 3em 1em;
border: 1px black solid;
border-width: 1px 5px 5px 1px;
border-color: red green blue yellow;
margin: 1em 5em;
}
link 沒有點擊過的鏈接
visited以點擊過的鏈接
active獲得焦點時的鏈接(比如在點擊時)
hover 鼠標(biāo)在鏈接上面
a.snowman:link {
color: blue;
}
a.snowman:visited {
color: purple;
}
a.snowman:active {
color: red;
}
a.snowman:hover {
text-decoration: none;
color: blue;
background-color: yellow;
}