天天看点

颜色与字体属性

font-size 字体大小                font-style  斜体              font-weight  字体粗细(100-900,bold / bolder)            line-height行高

font-family字体                    font简写:字体大小/行高    字体          

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			.box{
				color: #FF0000;
				font-family: "微软雅黑";
			}
			.a{
				color: rgb(0,255,0);
				font-family: "新宋体";
			}
			.a1{
				color:rgba(0,0,255,0.3)
				font-family:"楷体"
			}
			.a2{
				color: rgba(100%,0%,0%,0.5);
	
			}
			p{
				font-size: 20px;
			}
			.a3{
				font-style: italic;
			}
			.p1{
				font-weight: 600;
				background: lightblue;
				line-height: 30px;
			}
			.p2{
				font-weight:lighter;
				opacity: 0.5;
				background: lightcoral;
				font: 30px/35px "楷体"
			}
			
		</style>
	</head>
	
	<body>
	
		<p class="box">我是p标签</p>
		<p class="a">我是p标签</p>
		<p class="a1">我是p标签</p>
		<p class="a2">我是p标签</p>
		<p class="a3">我是p标签</p>
		<p class="p1">我是p标签</p>
		<p class="p2">我是p标签</p>
		
	</body>
</html>
           

运行效果如下:

颜色与字体属性