当前位置:网站首页>Two ways to center block level elements
Two ways to center block level elements
2022-06-25 23:45:00 【Delusion_ wangx】
1、 Without setting absolute positioning , After setting the width of the block level element, use margin:0 auto; In the middle
2、 Set to absolute positioning , Adjust the distance from the left margin to the center according to the width ,
example :
position: absolute;
left: 25%;
width: 50%;
or
position: absolute;
left: 50%;
margin-left: -50px;
width: 100px;
There is no problem in centering these two methods , But with absolute positioning , Reuse margin:0 auto Nine cannot be centered . The specific reason is unknown , I checked several articles , It is said that this is the rule , Just use it . Later, due to limited time, I didn't go deep into it . If you know the reason, please leave a message in the comment area , Thank you for the first ,
边栏推荐
- ACM. Hj16 shopping list ●●
- The simplest screen recording to GIF gadget in history, licecap, can be tried if the requirements are not high
- mysql
- 第五章 习题(124、678、15、19、22)【微机原理】【习题】
- Analysis on the control condition and mode of go cooperation overtime exit
- Apache Doris1.0版本集群搭建、负载均衡与参数调优
- php socket通信中stream_select方法的理解
- Megacli常用命令整理
- php进程间传递文件描述符
- util. Collection and encapsulation of JS tool functions
猜你喜欢

Reprint: detailed explanation of qtablewidget (style, right-click menu, header collapse, multiple selection, etc.)

Visual studio code create minimal web API (asp.net core)

Binary, hexadecimal, big end and small end
![Classic image segmentation network: UNET supports libtorch deployment reasoning [with code]](/img/3a/fb3bfe673db5123e3124404f3905c0.png)
Classic image segmentation network: UNET supports libtorch deployment reasoning [with code]

YUV444、YUV422、YUV420、YUV420P、YUV420SP、YV12、YU12、NV12、NV21

如何设计产品的roadmap?

第五章 习题(124、678、15、19、22)【微机原理】【习题】

mysql版本升级+数据迁移

idea 查看单元测试覆盖率

debezium
随机推荐
C. Yet Another Card Deck-Educational Codeforces Round 107 (Rated for Div. 2)
Uniapp -- framework arrangement and analysis summary
对伪类的理解
mysql集群
Mutual conversion between QT utf8 and Unicode encoding, and the Unicode encoding output format is &xxxxx
Solve 'tuple' object has no attribute 'lower‘
Wireshark对IMAP抓包分析
Database - mongodb
Analyse des cinq causes profondes de l'échec du développement de produits
Analysis on resource leakage /goroutine leakage / memory leakage /cpu full in go
聊聊swoole或者php cli 进程如何热重启
先序线索二叉树
18亿像素火星全景超高清NASA放出,非常震撼
C# IO Stream 流(二)扩展类_封装器
idea 查看单元测试覆盖率
Classic image segmentation network: UNET supports libtorch deployment reasoning [with code]
The software test interview has been suspended. The interviewer always says that the logical thinking is chaotic. What should I do?
经典图像分割网络:Unet 支持libtorch部署推理【附代码】
Today's 61 Fu
Kylin