当前位置:网站首页>绝对定位时元素水平垂直居中
绝对定位时元素水平垂直居中
2022-07-03 17:06:00 【The pure land】
假设元素长宽均为100px,使其水平垂直居中有两种方法
1.
.item{
position:absolute;
left:50%;
top:50%;
margin-left:-50px;/*100px的一半*/
margin-top:-50px;/*100px的一半*/
}
2.
.item{
position:absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
margin:auto;
}
边栏推荐
- Mysql database -dql
- Free data | new library online | cnopendata complete data of China's insurance intermediary outlets
- CC2530 common registers for timer 1
- What material is 12cr1movr? Chemical property analysis of pressure vessel steel plate 12cr1movr
- Simple configuration of postfix server
- 在iptables防火墙下开启vsftpd的端口
- 2022.02.14_ Daily question leetcode five hundred and forty
- [2. Basics of Delphi grammar] 1 Identifiers and reserved words
- Life is still confused? Maybe these subscription numbers have the answers you need!
- 29:第三章:开发通行证服务:12:开发【获得用户账户信息,接口】;(使用VO类包装查到的数据,以符合接口对返回数据的要求)(在多处都会用到的逻辑,在Controller中可以把其抽成一个共用方法)
猜你喜欢

Network security web penetration technology

Thread pool: the most common and error prone component of business code

Mysql database DDL and DML

Why is WPA3 security of enterprise business so important?

Talk about several methods of interface optimization

How do large consumer enterprises make digital transformation?

New library online | cnopendata complete data of Chinese insurance institution outlets
The way of wisdom (unity of knowledge and action)

Prepare for the golden three silver four, 100+ software test interview questions (function / interface / Automation) interview questions. win victory the moment one raises one 's standard

CC2530 common registers for ADC single channel conversion
随机推荐
27. Input 3 integers and output them in descending order. Pointer method is required.
C语言按行修改文件
Analysis of variance summary
RedHat 6.2 configuring ZABBIX
PHP converts a one-dimensional array into a two-dimensional array
New library online | cnopendata China bird watching record data
Kindeditor editor upload image ultra wide automatic compression -php code
Daily code 300 lines learning notes day 10
New features of C 10
Apache service suspended asynchronous acceptex failed
What is the material of sa302grc? American standard container plate sa302grc chemical composition
27. 输入3个整数,按从大到小的次序输出。要求用指针方法实现。
29:第三章:开发通行证服务:12:开发【获得用户账户信息,接口】;(使用VO类包装查到的数据,以符合接口对返回数据的要求)(在多处都会用到的逻辑,在Controller中可以把其抽成一个共用方法)
[try to hack] active detection and concealment technology
Kotlin learning quick start (7) -- wonderful use of expansion
visual studio “通常每个套接字地址(协议/网络地址/端口)只允许使用一次“
JSON 与 BSON 区别
PHP online confusion encryption tutorial sharing + basically no solution
[combinatorial mathematics] recursive equation (example of recursive equation 2 Hanoi Tower | example of recursive equation 3 insertion sequencing)
[2. Basics of Delphi grammar] 1 Identifiers and reserved words