因为之前做得太惨不忍睹了,而且大部分篇幅很长就不放了从第四个开始,一边学一边做也没办法说好啥时候能更新,只能一点点来了。尽力。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
.main{
position:absolute;
width:400px;
height:200px;
top:50%;
left:50%;
margin:-100px 0 0 -200px;
background:#ccc;
}
.left-top-area{
width:50px;
height:50px;
left:0px;
top:0px;
position:relative;
border-radius: 0 0 50px 0;
background:#fc0;
}
.right-bottom-area{
right:0px; bottom:0px;
position:relative;
border-radius: 50px 0 0 0;
background: #fc0
width:50px;
height:50px;
}
</style>
</head>
<body>
<div class="main">
<div class="left-top-area"></div>
<div class="right-bottom-area"></div>
</div>
</body>
</html>
这个题的题目是div居中问题。我在class命名上抄了一下第一名的,不好意思了,实在是不怎么会。刚做的时候,把两个小的div的position设置成了absolute,还想了半天为什么,昨天才刚自己写的absolute会让元素脱离文档流。真的是笨