1、内嵌式
2、外联式
3、 行内样式
4、import
代码?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./外联.css">
<title>Document</title>
</head>
<style>
@import url(./外联css2.css);
.innerCss {
height: 100px;
width: 100px;
background-color: yellow;
margin: 20px;
}
</style>
<body>
<div class="innerCss">
这是用内嵌式的块
</div>
<div class="outerCss">
这是用外联式的块
</div>
<div class="lineCss" style="height: 100px;width: 100px;background-color: greenyellow;margin: 20px;">
这是用行内样式的块
</div>
<div class="importCss">
这是用importd导入的块
</div>
</body>
</html>
.outerCss{
height: 100px;
width: 100px;
background-color: pink;
margin: 20px;
}
.outerCss{
height: 100px;
width: 100px;
background-color: burlywood;
margin: 20px;
}
?
|