子元素位于父元素中央 css实现
2024-09-07 03:00:16
wrap .box{
width: 200px;
height:200px;
background: pink;
// 方案1
position: absolute;
top:0;
left:0;
right:0;
bottom:0;
margin: auto;
//方案2
position:absolute;
top:50%;
left:50%;
transfrom:translate(-50%,-50%);
}
//方案3
wrap{
width:500px;
height: 500px;
background: gray;
display: flex;
justify-content: center; // 主轴水平居中
align-items: center; // 侧轴居中
}
最新文章
- 设计模式01观察者模式(java)
- 关于SQL Server 2008添加用户映射问题 解决办法
- Yii 验证码验证
- Web.config配置文件详解(新手必看)
- Redis学习手册
- 百万级数据mysql分区
- QVM 实操记 - 18.12.28
- 数学基础IV 欧拉函数 Miller Rabin Pollard's rho 欧拉定理 行列式
- 用递归方法判断字符串是否是回文(Recursion Palindrome Python)
- Programming Specification
- Django集成Markdown编辑器【附源码】
- Screen、IP
- python 爬虫--同花顺-使用代理
- mybatis之关联(2)
- Ultraedit使用小技巧
- 查看eclipse版本信息
- pandas 处理数据中NaN数据
- Extjs加载本地的一个json文件
- Google’s Project Tango is shutting down because ARCore is already here
- 鼠标指向表格时 显示更多信息 toolTipController1