<!DOCTYPE html>
<html>
<head>
<title>HTML 设置字体样式</title>
<style>
/* 使用 CSS 设置字体样式 */
.custom-font {
font-family: Arial, sans-serif; /* 设置字体为 Arial 或无衬线字体 */
font-size: 20px; /* 设置字体大小为 20 像素 */
font-weight: bold; /* 设置字体加粗 */
font-style: italic; /* 设置字体为斜体 */
color: blue; /* 设置字体颜色为蓝色 */
}
</style>
</head>
<body>
<p class="custom-font">这是一个设置了字体样式的段落。</p>
</body>
</html>
font-family
: 指定字体系列,这里是 Arial 或者其他无衬线字体。font-size
: 设置字体大小,单位可以是像素 (px)、百分比 (%) 或其他单位。font-weight
: 控制字体的粗细,bold
表示加粗。font-style
: 设置字体样式,italic
表示斜体。color
: 设置文本的颜色。上一篇:纯html网页模板
下一篇:html和css怎么连接
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站