下面的代碼覆蓋了初級教程的所有方面,保存下面的CSS文件并且在瀏覽器里觀看連接的HTML,你可以明白各個CSS屬性的用法。最好的學習方法就是理解作用在HTML上的CSS文件,改變CSS HTML會發生什么變化。
body {
    font-family: arial, helvetica, sans-serif;
    font-size: 80%;
    color: black;
    background-color: #ffc;
    margin: 1em;
    padding: 0;
}
/* By the way, this is a comment */
p {
    line-height: 1.5em;
}
h1 {
    color: #ffc;
    background-color: #900;
    font-size: 2em;
    margin: 0;
    margin-bottom: 0.5em;
    padding: 0.25em;
    font-style: italic;
    text-align: center;
    letter-spacing: 0.5em;
    border-bottom-style: solid;
    border-bottom-width: 0.5em;
    border-bottom-color: #c00;
}
h2 {
    color: white;
    background-color: #090;
    font-size: 1.5em;
    margin: 0;
    padding: 0.1em;
    padding-left: 1em;
}
h3 {
    color: #999;
    font-size: 1.25em;
}
img {
    border-style: dashed;
    border-width: 2px;
    border-color: #ccc;
}
a {
    text-decoration: none;
}
strong {
    font-style: italic;
    text-transform: uppercase;
}
li {
    color: #900;
    font-style: italic;
}
table {
    background-color: #ccc;
}
推薦設計
 - 優秀海報設計精選集(8)海報設計2022-09-23 
 - 充滿自然光線!32平米精致裝修設計2022-08-14 
 - 親愛的圖書館 | VERSE雜誌版版式設計2022-07-11 
 - 生活,就該這麼愛!2022天海報設計2022-06-02 
最新文章
 - 10個CSS簡寫/優化技巧CSS教程2013-06-04 
 - css的margin縮寫方式CSS教程2012-05-23 
 - CSS網頁布局時常犯的幾種CSS教程2009-09-28 
 - CSS浮動屬性Float詳解CSS教程2009-09-17 






