盒子:边框border、内容、padding内边距
版心(大盒子)
盒子的作用:给网页布局
windth:宽 height:高
border:边款
solid实线 虚线dashed 点线dotted
padding:内边距
left:左 right:右 top:上 bottom:下
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>盒子模型</title>
<style>
.box{
width:1266px;
height: 52px;
border: solid 1px black;
/*当写一个值:上下左右都是同一个内边距*/
/*写两个值:第一个值代表上下,第二个值左右*/
/*三个值:第一个代表上,第二个代表左右,第三个代表下*/
/*四个值:上 右 下 左 顺时针*/
/*padding:20px 10px 15px 30px ;*/
/*padding-left:左内边距*/
padding-left: 40px;
padding-right: 20px;
padding-top: 24px;
padding-bottom: 10px;
}
.box2{
width: 200px;
height: 20px;
border: solid 1px red;
}
</style>
</head>
<body>
<div class="box">
<div class="box2"></div>
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>盒子模型练习</title>
<style>
.box{
width: 500px;
height: 200px;
border: solid 5px red;
border-bottom: solid 10px green;
padding:10px;
background-color: blue;
/*盒子背景颜色:background-color*/
font-size:30px
}
</style>
</head>
<body>
<div class="box"><marquee>呜哈哈</marquee></div>
<!--文字动画走马灯:<marquee></marquee>-->
</body>
</html>