HTML中字体和文本属性

1、字体基本属性

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title> 字体属性</title>

</head>
<body>
<span style="color:#888888">测试1</span>
<span style="color:red">测试2</span>
<span style="font-family:'隶书'">测试3</span>
<span style="font-size:xx-large">测试4</span>

</body>
</html>

运行结果为:

xx-small最小字体

x-small较小字体

small小字体

medium中等字体 默认值

large大字体

x-large较大字体

xx-large最大字体

larger、smaller:相对字体大小

length设置字体大小

2、text-shadow添加阴影

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title> 字体属性</title>

</head>
<body>
<span style="text-shadow:5px  5px 2px  #555">测试1</span><br>
<span style="text-shadow:5px  8px 5px  #999">测试2</span<br>
<span style="text-shadow:10px  5px 2px  #555">测试3</span><br>
<span style="text-shadow:10px  10px 2px  #555">测试4</span>

</body>
</html>

<span style="text-shadow:2px 3px 4px #555">

2px 3px 为阴影坐标地址

4px模糊半径 越大越模糊

font-size-just:属性值一般设置为aspect值。(aspect值:例如某个字体的大小为100px,该字体中小写字母x的大小是58px,则这个字体的aspect值为0.58,所以没种字体的aspect值是固定的)

3、CSS中颜色表示

1、颜色名表示 如:white,black

2、rgb(x,x,x)  x取值范围0~255

3、rgb(x,x,x,a) a表示透明度

猜你喜欢

转载自blog.csdn.net/eggplant_/article/details/82825821