用CSS样式完成作业

1、css设置字体和文字样式
html

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>css_font</title>
		<link rel="stylesheet" type="text/css" href="css/css_font.css"/>
	</head>
	<body>
		<div>
			<!--字体类型-->
			<p>font-family定义字体类型</p>
		</div>
		<div>
			<!--字体大小-->
			<p>font-size定义字体大小</p>
		</div>
		<div>
			<!--字体粗细-->
			<p>font-height定义字体粗细</p>
		</div>
		<div>
			<!--斜体字体-->
			<p>font-style定义斜体字体</p>
		</div>
		<div>
			<!--下划线-->
			<p>text-decoration定义贯穿线</p>
			<p>text-decoration定义下划线</p>
			<p>text-decoration定义闪烁</p>
			<p>text-decoration定义上划线</p>
		</div>	
		<div>
			<!--行高设定-->
			<p>line-height定义行高</p>
		</div>
		<div>
			<!-- 定义文本对齐 -->
			<p>text-align定义文本左对齐left</p>
			<p>text-align定义文本右对齐right</p>
			<p>text-align定义文本居中对齐center</p>
			<p>text-align定义文本两端对齐justify</p>
		</div>
		<div>
			<!-- 定义垂直对齐 -->
			<p>vertical-align一般用于文字图片居中</p>
		</div>
		<div>
			<!-- 定义字距和词距 -->
			<p>字距letter-spacing</p>
			<p>词距word-spacing</p>
		</div>
		<div>
			<!-- 定义缩进 -->
			<p>定义缩进</p>
		</div>
		<div>
			<!-- 定义文本阴影 -->
			<p>text-shadow定义文本阴影</p>
		</div>
	</body>
</html>

css

div:first-child p:first-child{
   
	background-color: #AA9090;
	font-family: fantasy,"楷体";
}
div:nth-child(2) p:first-child
  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值