基本布局和块状元素
16lz
2021-11-12
浏览效果
前
后
代码如下:
<!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>基本布局</title>
<style>
.main{
width: 400px;
height: 800px;
background: #6ff;
position: absolute;
top: 40px;
left: 400px;
display: inline;
}
.top{
width: 380px;
height: 190px;
position: relative;
background: coral;
margin-top: 10px;
margin-left: 10px;
}
.line{
width: 130px;
height: 400px;
position: relative;
background: royalblue;
float: left;
margin-top: 10px;
margin-left: 10px;
}
.line2{
width: 130px;
height: 400px;
position: relative;
background: #432;
float: right;
margin-top: 10px;
margin-right: 10px;
}
.foot{
width: 380px;
height: 150px;
position: relative;
background: seashell;
margin-left: 10px;
margin-top: 430px;
}
/* 隐藏与显示 */
.st{
display: none;
}
.main:hover .st{
display: block;
}
</style>
</head>
<body>
<div class="main">
<div class="top"></div>
<div class="st">
<div class="line"></div>
<div class="line2"></div>
</div>
<div class="foot"></div>
</div>
</body>
</html>
更多相关文章
- 学习PHP中好玩的Gmagick图像操作扩展的使用
- 招聘h5页面是什么?意派Epub360老司机带你制作招聘h5页面
- 数组遍历代码
- fetch应用——访问JSON数据
- PHP保姆级API制作教程,不会剁手
- 意派Epub360丨国庆节品牌推广H5案例,有趣的作品才更吸引人
- 模态框 flex grid
- PHP生成RSS文件类实例
- 初识html标签