|
如果你学完HTML初级教程即可学习CSS初级教程,使用CSS处理HTML样式。
下面的代码覆盖了初级教程的所有方面,保存下面的CSS文件并且在浏览器里观看连接的HTML,你可以明白各个CSS属性的用法。最好的学习方法就是理解作用在HTML上的CSS文件,改变CSS HTML会发生什么变化。
Example Source Code [www.xxcss.com]
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; }
|