当前位置:网站首页>How to center the positioned text horizontally and vertically
How to center the positioned text horizontally and vertically
2022-07-02 21:48:00 【Become your own light~】
//left: 50%;
//top: 50%;
// Horizontal vertical center
//transform: translate(-50%, -50%);
// These three are the solutions to make it vertically centered after using absolute positioning
div{
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 130px;
height: 100px;
z-index: 999;
opacity: 0.5;
}
// Horizontal center
p{
position: absolute;
bottom:10px;
left: 50%;
transform: translate(-50%, 0);
}
边栏推荐
- Structure array, pointer and function and application cases
- VictoriaMetrics 简介
- tinymce可视化编辑器增加百度地图插件
- Research Report on plastic antioxidant industry - market status analysis and development prospect forecast
- China's crude oil heater market trend report, technological innovation and market forecast
- [CV] Wu Enda machine learning course notes | Chapter 12
- Huawei Hongmeng watch achieves fireworks display effect on New Year's Eve
- Chargement de l'image pyqt après décodage et codage de l'image
- 一周生活
- Blue Bridge Cup Eliminate last one (bit operation, code completion)
猜你喜欢
Daily book - low code you must understand in the era of digital transformation
Redis distributed lock failure, I can't help but want to burst
The source code of the daily book analyzes the design idea of Flink and solves the problems in Flink
MySQL learning record (9)
How to prevent your jar from being decompiled?
Off chip ADC commissioning record
Etcd Raft 协议
MySQL learning record (6)
Unexpectedly, there are such sand sculpture code comments! I laughed
TinyMCE visual editor adds Baidu map plug-in
随机推荐
[shutter] statefulwidget component (pageview component)
tinymce可视化编辑器增加百度地图插件
Golang string segmentation
Browser - clean up the cache of JS in the page
[use of pointer and pointer and array]
Structure array, pointer and function and application cases
Today, I met a Alipay and took out 35K. It's really sandpaper to wipe my ass. it's a show for me
Construction and maintenance of business websites [9]
Research Report on micro vacuum pump industry - market status analysis and development prospect prediction
Construction and maintenance of business websites [10]
[sword finger offer] 56 - I. the number of numbers in the array
【剑指 Offer】56 - I. 数组中数字出现的次数
Physical layer cables and equipment
[Jianzhi offer] 56 - ii Number of occurrences of numbers in the array II
[shutter] shutter layout component (physicalmodel component)
[CV] Wu Enda machine learning course notes | Chapter 12
Gee: (II) resampling the image
Pyqt picture decodes and encodes and loads pictures
2019 Nanchang (relive the classic)
读博士吧,研究奶牛的那种!鲁汶大学 Livestock Technology 组博士招生,牛奶质量监测...