<!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>文本样式:设置字体、颜色、大小、粗细、对齐方式、背景色、高度、文本装饰、文本行的高度</title>
<style>
div{
font-family: "宋体";
color: darkorange;
font-size: 50px;
font-weight: bold;
text-align:center ;
background-color: aquamarine;
height: 300px;
text-decoration: line-through;
line-height: 6; /* 或者 line-height: 300px; */
/* 要想让字体居中,有两种方式:一:line-height = height/font-size。 方式二:line-height = height。*/
}
a{
text-decoration: none;
CSS基础:设置文本样式(字体、颜色、大小、粗细、对齐方式、背景色、高度、文本装饰、文本行的高度)
于 2022-07-01 14:52:06 首次发布