如果你学完HTML初级教程即可学习CSS初级教程,使用CSS处理HTML样式。

  下面的代码覆盖了初级教程的所有方面,保存下面的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;
}

扫码关注公众号 获取更多设计资源...
↓↓↓
白嫖福利 | 限时领取
摹客超级版会员(价值1250元)解锁摹客协作、摹客RP、摹客DT所有功能。
公众号主页发送 “激活” 免费获取 激活码
↓↓↓
公众号主页发送 “字体” 获取 全套可商用字体包...
↓↓↓
公众号主页发送 “vi” 获取 500个著名品牌vi设计手册...

随机推荐