CSS,在HTML文件中的head标签,它的主要作用是修改HTML文件中的样式、字体、颜色等等。
基本格式为:
<style type="text/css">
标签{
属性;
}
</style>
其中属性的基本格式为:
属性名+冒号(:)+属性具体名称+分号(;)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>标题</title>
<style type="text/css">
h1 {
color: green;
text-align: center;
font-family: 方正姚体;
}
p {
text-align: center;
color: red;
font-family: 幼圆;
}
</style>
</head>
<body>
<form>
<h1>标题</h1>
<p>段落1</p>
<p>段落2</p>
<p>段落3</p>
</form>
</body>
</html>