本篇,主要是文本与背景相关的属性。因为本篇内容比较简单,就不作多文字说明了,主要自己要多尝试。
代码演示:
<!doctype>
<html>
<head>
<title>CSS属性之背景</title>
<meta charset="utf-8">
<style type="text/css">
body{
background-image:url(abc.jpg);
background-repeat:no-repeat;
background-position:20px 20px;
}
</style>
</head>
<body>
</body>
</html>
运行结果:
代码演示:
<!doctype>
<html>
<head>
<title>CSS属性之文本</title>
<meta charset="utf-8">
<style type="text/css">
div{
width:300px;
hieght:300px;
}
p{
text-align:left;
font-size:20px;
line-height:200%;
text-indent:40px;
letter-spacing:5px;
word-spacing:10px;
direction:ltr;
text-transform:capitalize;
}
</style>
</head>
<body>
<div>
<p>从前山里有座庙,庙里有一个老和尚,老和尚在给小和尚讲故事,讲什么故事呢</p>
<p>My name is HougeLin</p>
</div>
</body>
</html>
运行结果:
代码演示部分还不完整,需要自己一个个去测试才知道具体怎么作用的。