<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.title{
width: 200px;
height: 50px;
background-color: aqua;
color: yellowgreen;
font-weight: 900;
font-size: larger;
text-align: center;
line-height: 50px;
}
p{
width: 500px;
font-size: 16px;
text-indent: 2em;
text-align: justify;
}
.sp1{
color: blue;
font-weight: bolder;
letter-spacing: 10px;
}
.sp2{
color: red;
text-decoration: underline;
}
.sp3{
font-style: oblique;
}
</style>
</head>
<body>
<div class="title">
历史渊源
</div>
<p>
<span class="sp1">冰淇淋是冷冻食品发展而来的。</span>
<span class="sp2">早在公元1世纪,</span>
古罗马国王就叫奴隶们夏天从高山上<span class="sp2">采集冰雪</span>,
用于<span class="sp3">冷冻水果、蜂蜜和果汁</span>。国王常常在夏天用
这些冷冻食品来招待宠臣和国外使者。<sup>[7] </sup>
</p>
</body>
</html>
CSS中采用选择器修饰文本,比如颜色,文本位置,背景颜色,文字间距,倾斜,加粗等等在代码中均有体现,运行结果如图所示