html引用css的一个实例

如何引用css
1.外联式(解耦性大)
2.内嵌式

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<!-- 外联式 -->
	<link rel="stylesheet" type="text/css" href="./css的页面引用.css">
	<!-- 内嵌式 -->
	<style type="text/css">
		h1{
			font-size: 45px;
			color: gold;
		}
	

	</style>
</head>
<body>
	<h2 class="green big">武士大哥</h1>
	<h1 id="h101">我说的</h1>
	<div align="center">hhhhhhh</div>
	<!-- 行内样式 -->
	<a href="baidu.com" style="font-size:50px color:pink" >百度</a>
	<div class="box">dhasjikAhdjskGhjfhdjagyueJ<span>DKgaydhjkalHUAISHKhsdIGDHSXGushjsaHJKSDSH</span>
	案审判回<span class="span01">复i饿啊u啊液体</span>饿我去饿金佛啊啊回复第十九<span class="span02">卡拉恢复健康的喇叭</span>裤法律的安居客六发动机撒开放接口和卡罗拉还会对怕互派大使肌肤的卡片哈迪斯否额外衣服好看安徽快递师傅i哦委屈恶虎Akd
	</div>

	<a href="baidu.com" class="link"> baidu </a>
</body>
</html> 
div{
	font-size: 33px;
	color: green;

}
/*css常用样式*/
h2{
	font-size: 25px;
	color: pink;
	font-family: '微软雅黑';
	/*用中文可能会导致乱码,可以改用Microsoft Yahei*/
	font-style: italic;
	/*文字倾斜  normal为正常 */
	font-weight: bold;
	/* 文字加粗 normal为正常 */
	line-height: 40px;
	/* 行高 包括字体大小 */

	/* 也可以font:normal 20px/40px 'Microsoft Yahei'; */
	/*font:是否加粗 字号/行高 字体*/

	text-decoration: underline;
	text-indent: 40px;
	/* 首行缩进*/
	text-align: center;
}

*{
	font-size: 50px
}
/*对所有的标签进行操作*/
#h101{
	color: blue;
}
/*id选择器 注意覆盖情况*/

.green{
	color: green;
}
.big{
	font-size: 50px;
}
/*类选择器  id选择器优先于类选择器*/

.box{
	font-size: 20px;
	line-height: 40px;
	text-indent: 40px;
}
.box span{
	color: red;
	font-size: 30px;
}

.box .span01{
	color: blue;
	/*font-size: 40px;*/
}
.box .span01,.span02{
	font-size: 40px;
}
/*多项相同的属性放在一起*/
/*层级选择器*/

/*伪类选择器*/
.link{	
	font-size: 40px;
	color: green;
}
.link:hover{
	color: gold;
	font-weight: bold;
	
}

/*伪元素 具有无法选中的特性 一般用于解决bug*/
.box:before{
	content: "wahahaha";
	color: black;
}
.box:after{
	content: 'haishuaihd';
	color: black;
}

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值