3、都有哪些样式?
背景色:
background-color
字体颜色:
color
字体大小:
font-size
宽、高
height:
width:
边框
border: 2px solid firebrick;
内外边距
pandding
内边距:元素和内部元素的间距叫内边距
margin
外边距:元素和外部的间距叫外边距
4、如何实现下面的图框????
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<div style="width: 20%;height:10000px;float: left;background-color: rgb(69, 71, 71);">div</div>
<div style="width: 80%;height:10000px;float: left;background-color: rgb(145, 158, 168);">div</div>
</body>
</html>
5、实现又一个展现
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
.miao{
margin-top: 20px;margin-bottom: 20px;height: 100px;margin-left: 20px;margin-right: 20px;width: 1000px;
/* border: 2px solid black; */
}
</style>
</head>
<body>
<div style="width: 20%;height:10000px;float: left;background-color: rgb(238, 234, 239);">距离宝宝出生还有110天</div>
<div style="width: 80%;height:10000px;float: left;background-color: rgb(208, 216, 222);">
<div class="miao" style="background-color: rgb(211, 222, 170);">
倒计时开始
</div>
110
</div>
</div>
</body>
</html>
6、位置position、float
position:
fixed:固定在某一个位置 height为100%时,依托于屏幕的大小
absolute: 绝对位置,找的是屏幕的绝对位置 通过top、left、right、bottom来进行控制
relative:相对父元素位置 通过top、left、right、bottom来进行控制
<div class="pg-content" style="width: 80%;height:1000px;float: right;background-color: rgb(59, 219, 179)">
<p style="position: absolute;top: 40px;left: 100px">这个是一个会找到绝对位置的 p标签 </p>
<p style="position: relative;top:40px;left: 100px;">相对位置的P标签</p>
<div class="pg-content-desc">
<p style="display: inline">80%</p>
<p style="display: inline">70%</p>
<span style="display: block">span1</span>
<span style="display: block">span2</span>
<span style="display: inline-block">inline-block</span>
<span style="display: None">inline-block-p</span>
</div>
</div>
7、display:
inline: 把块级标签转为行内标签,如
<p>
block: 把行内标签转为块级标签 ,如
<span>
inline-block: 即是块级又是行内标签
None:不显示,隐藏
<div class="pg-content" style="width: 80%;height:1000px;float: right;background-color: rgb(59, 219, 179)">
<p style="position: absolute;top: 40px;left: 100px">这个是一个会找到绝对位置的 p标签 </p>
<p style="position: relative;top:40px;left: 100px;">相对位置的P标签</p>
<div class="pg-content-desc">
<p style="display: inline">80%</p>
<p style="display: inline">70%</p>
<span style="display: block">span1</span>
<span style="display: block">span2</span>
<span style="display: inline-block">inline-block</span>
<span style="display: None">inline-block-p</span>
</div>
</div>