<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>div的盒子模型学</title>
<style type="text/css">
#showdiv{
border: solid 1px;
width:300px;
height: 300px;
background-color: bisque;
/*定位学习*/
/*绝对定位*/
position: absolute;
left: 100px;
top: 100px;
}
#div01{
border: solid 1px;
width: 130px;
height: 120px;
background-image: url(css/1.jpg);
background-size: cover;
background-repeat: no-repeat;
position: relative;
left: 100px;
right: 100px;
}
#div02{
width: 120px;
height: 120px;
border: solid 2px;
background-color: blue;
/*定位*/
/*相对位置*/
position: relative;
left: 100px;
top: 20px;
/*盒子模型*/
/*内边距*/
padding: 10px;
/*外边距*/
margin: 10px;
}
</style>
</head>
<body>
<p>
盒子模型:div的嵌套
css学习:
css设置盒子模型
最新推荐文章于 2024-04-14 12:49:42 发布