博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
小div在大div中垂直居中,以及div在页面垂直居中
阅读量:4501 次
发布时间:2019-06-08

本文共 483 字,大约阅读时间需要 1 分钟。

<html>

<head>
<title>淘宝 2faner</title>
<style type="text/css">
.big{
width: 800px;
height: 500px;
background: #333;
position:absolute;
left: 50%;
top: 50%;
margin-left:-400px; 
margin-top: -250px;

}

.small{
width: 400px;
height: 200px;
position: absolute;
left: 50%;
top: 50%;
margin-left:-200px; 
margin-top: -100px;
background: #fff;
}
</style>
</head>
<body>
<div class="big">
<div class="small">
 
</div>
</div>
</body>
</html> 

 

转载于:https://www.cnblogs.com/275147378abc/p/5496653.html

你可能感兴趣的文章
HDUOJ -----Color the ball
查看>>
HashMap
查看>>
docker建立一个博客的过程
查看>>
基于jquery带时间轴的图片轮播切换代码
查看>>
自已在别人基础上封装的AES数法 C++
查看>>
python函数、装饰器、迭代器、生成器
查看>>
[转]Windows数据类型
查看>>
CodeForce - 1189 D1. Add on a Tree (思维题)
查看>>
C 计算数组长度
查看>>
获取带参数的微信小程序二维码
查看>>
爬虫模块BeautifulSoup
查看>>
【模板】并查集
查看>>
RabbitMQ使用教程(一)RabbitMQ环境安装配置及Hello World示例
查看>>
[WPF]实现密码框的密码绑定
查看>>
更新k8s镜像版本的三种方式
查看>>
WPF 获得当前输入法语言区域
查看>>
绑定元素属性改变不通知界面
查看>>
C#中使用反射获取结构体实例
查看>>
Spring bean的作用域和生命周期
查看>>
ado.net增删改查练习
查看>>