HTML的CSS样式不会怎么办?

本文是CSS新手教程,介绍了类名和ID选择器的应用,详细解释了各种样式属性如字体、颜色、背景、对齐和文本装饰。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>CSS新手教程</title>
	<style type="text/css">
		/*class表示类名选择器 .*/
		/*id表示id选择器  #*/
		.two {
			height: 5000px;
			/*font-size设置文字大小*/
			font-size: 400px;
			/*color设置文字颜色*/
			color:green ;
			color: rgb(0,0,255);
			/*字体样式  normal表示正常 italic表示斜体 oblique强制倾斜*/
			font-style: italic;
			/*字体粗细 400 blod加粗*/
			font-weight: 100;
			/*text-shadow: 设置文字阴影(横轴,竖轴 模糊距离 模糊颜色)*/
			/*text-shadow: 100px 100px 0 red;*/
			/*letter-spacing: 表示文字间距*/
			/*letter-spacing: 400px;*/
			/*text-decoration文本装饰 underline*/
			/*text-decoration: line-through;*/
			/*text-indent 文本缩进*/
			/*text-indent: 800px;*/
			/*text-align设置文本水平对齐方式 left right center*/
			text-align: center;



			/*设置背景颜色 background-color*/
			/*background-color: red;*/
			/*设置背景图片*/
			/*background-image: url(冬天2.jpg);*/
			/*设置背景图片大小*/
			/*background-size: 400px 400px;*/
			/*background-repeat: 设置背景图片重复方式 repeat默认重复 repeat-x repeat-y no-repeat*/
			/*background-repeat: no-repeat;*/
			/*设置背景图片位置  background-position: 水平方向 垂直方式;*/
			/*水平 left center right*/
			/*垂直 top center bottom*/
			/*background-position: center top;*/
			/*background-attachment 固定背景图像*/
			/*scroll	背景图片随着页面的滚动而滚动,这是默认的*/
			/*fixed	背景图片不会随着页面的滚动而滚动*/

			/*background-attachment: fixed;*/
		}
	</style>
</head>
<body>
	<div class="two">CSS123</div>
	<div>123</div>
</body>
</html>

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值