<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS样式</title>
</head>
<body>
<!-- 第一种CSS样式 行间样式(style属性) -->
<!-- 文本属性:
字体大小:font-size:20px;
字体颜色:color:red;
字体类型:font-family:fantasy;
字体加粗:font-weight:bold;
bold :粗体 bolder :更粗的粗体 lighter:更细的字体
100---700 从细到粗 400 为普通粗细 700为bold
字体倾斜:font-style:italic;
italic 倾斜字体样式 oblique 斜体样式
字体下划线:text-decoration:underline;
underline 下划线 overline 上划线 line-through 文本中间删除线
对齐方式:text-align:center;
center 居中: left 左对齐 : right : 右对齐
字间距:word-spacing:10px; 单词之间的距离(浏览器默认字中间空格间为一个单词的分割点)
字符间距:letter-spacing:10px; 每个字符之间的距离
行间距:line-height:100%; 每一行字的高度,不会影响字的大小,默认字体的位置在竖直位置居中
缩进:text-indent:20px; 首行缩进
-->
<span style="font-size:30px;color: red;margin-left: 100px; background-color:green; width: 500px; height:200px; display: block; text-align: center; line-height: 200px;">我是第一个span标签</span>
<span style="">我是第二个span标签</span>
</body>
</html>
网友评论