当前位置:网站首页>内联元素居中
内联元素居中
2022-07-31 09:10:00 【aら 淼】
父元素:
height:100px;
line-height:100px; // 与高相同
text-align:center;
子元素:
display:inline;
vertical-align: middle;
适用图片、文字
<div>
<div class="wrapper">
<span>我是文字</span>
</div>
<div class="wrapper2">
<div>我是文字</div>
</div>
</div>
.wrapper {
height: 200px;
width: 200px;
background-color: antiquewhite;
line-height: 200px;
}
.wrapper2 {
height: 200px;
width: 200px;
background-color: antiquewhite;
line-height: 200px;
div{
height: 20px;
width: 20px;
}
}
边栏推荐
- [NLP] Interpretation of Transformer Theory
- Feign介绍
- JSP exception对象简介说明
- 科目三:左转弯
- MUI获取相机权限
- 刷题《剑指Offer》day05
- 35-Jenkins-Shared library application
- I advise those juniors and juniors who have just started working: If you want to enter a big factory, you must master these core skills!Complete Learning Route!
- PyQt5快速开发与实战 9.4 Matplotlib在PyQt中的应用
- 文件管理:目录管理
猜你喜欢
随机推荐
一些计时软件,生产力工具
The future of the hybrid interface: conversational UI
js雷达图统计图表插件
Andoird开发--指南针(基于手机传感器)
手写promise
【Redis高手修炼之路】Jedis——Jedis的基本使用
matlab常用符号用法总结
JSP page对象简介说明
SQL join table (inner join, left join, right join, cross join, full outer join)
Aleo Testnet3规划大纲
安装gnome-screenshot截图工具
JSP config对象的简介说明
[NLP] Interpretation of Transformer Theory
JSP session的生命周期简介说明
js部门预算和支出雷达图
期刊会议排名、信息检索网站推荐以及IEEE Latex模板下载
二叉树的搜索与回溯问题(leetcode)
刷题《剑指Offer》day06
js implements the 2020 New Year's Day countdown bulletin board
OpenGL es 导读篇








