练习
This commit is contained in:
48
teaching/林锦绣/css.html
Normal file
48
teaching/林锦绣/css.html
Normal file
@@ -0,0 +1,48 @@
|
||||
<!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">
|
||||
<title>Document</title>
|
||||
<!--
|
||||
网页的结构由 html(决定网页的结构) css(决定网页的样式) js(决定网页的交互)
|
||||
css(层叠样式表)
|
||||
引入 行内 html标签中写一个style=""
|
||||
内联样式 html文件内 的head里面 写 style标签 在这里面写css属性
|
||||
外部样式 link rel=stylesheet
|
||||
|
||||
语法 选择器{
|
||||
属性:属性值;
|
||||
属性:属性值
|
||||
}
|
||||
|
||||
盒模型
|
||||
margin 吞并 发生在两个块级元素垂直方向 规律是 取数大的间距
|
||||
* 通配符 选中的是整个网页上的所有元素
|
||||
-->
|
||||
<style>
|
||||
*{
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
.box{
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
background: red;
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
.box2{
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
background: blue;
|
||||
margin-top: 20px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p style="color:red"></p>
|
||||
<div class="box"></div>
|
||||
<div class="box2"></div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user