css如何设置标题与内容的距离 ?

html-css0126

css如何设置标题与内容的距离 ?,第1张

方法1、标题和内容之间加一个换行 <br />

方法2、标题设置css行高 {line-height:100px}

方法3、内容设置css{margin-top:40px}

方法4、标题设置css {margin-bottom:40px}

1、打开开发工具,新建一个HTML文件。

2、使用font-family属性设置,字体代码:.demo1{font-family: "microsoft yahei"}。

3、使用font-size属性设置字体的大小代码:.demo1{font-size: 20px}。

4、使用font-style 属性设置字体风格:normal - 文本正常显示italic - 文本斜体显示oblique - 文本倾斜显示。

5、使用font-weight属性设置字体的粗细代码:.demo2{font-weight: 600}。

6、使用color设置字体颜色代码:.demo1{color: #FF0000}。就完成了。

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<title>景安网络</title>

<style type="text/css">

span{font-size: 19px}

</style>

</head>

<body>

<span>文字大小</span>

</body>

</html>

css中我们可以使用font-size来设置文字的大小