当前位置:网站首页>Content ambiguity occurs when using transform:translate()
Content ambiguity occurs when using transform:translate()
2022-07-27 16:05:00 【Moving maple】

<div class="tancc" v-if="ifshow">
<div class="main">
<button class="close" @click="close()">X</button>
<ul>
<li>
<label for="name"> full name :</label>
<input type="text" id="name">
</li>
<li>
<label for="age"> Age :</label>
<input type="text" id="age">
</li>
<li>
<label for="address"> Address :</label>
<input type="text" id="address">
</li>
</ul>
</div>
</div>
.tancc{
width:100%;
height:100%;
position:fixed;
background: rgba(0, 0, 0, 0.2);
top:0;
left:0;
z-index: 200;
}
.tancc .main{
width:75%;
height:67%;
color:#666;
background: #fff;
margin:0 auto;
position: absolute;
top:50%;
left:50%;
transform: translate(-50%,-50%);
text-align:center;
}
The content is obviously vague , Get rid of transform after :
Turned out to be transform: translate(-50%,-50%) Influence
reason :translate(-50%,-50%) Decimal numbers appear in the calculation result
test height: from 201.0~201.9




test result : The closer the decimal part is 1, Input box border The clearer
in other words ,translate(-50%,-50%) The sharpness is the highest when the calculation result is an integer
resolvent :
1. When the width and height of the element are in absolute units
Elements weidth and height Set to even
2. When the width and height of elements are relative units
The calculation result is uncertain , Use display:flex or display:table To achieve the horizontal and vertical centering effect
边栏推荐
- [sword finger offer] interview question 53- Ⅱ: missing numbers in 0 ~ n-1 - binary search
- Summary of network device hard core technology insider router (Part 2)
- First acquaintance with MySQL database
- Ncnn reasoning framework installation; Onnx to ncnn
- Short video mall system, system prompt box, confirmation box, click blank to close the pop-up box
- [sword finger offer] interview question 49: ugly number
- [Yunxiang book club issue 13] coding format of video files
- JS operation DOM node
- 线程中死锁的成因及解决方案
- 文字批量替换功能
猜你喜欢

openwrt 增加RTC(MCP7940 I2C总线)驱动详解

无线网络分析有关的安全软件(aircrack-ng)

Three uses of static keyword

网络层的IP协议

The difference between synchronized and reentrantlock

Solve mt7620 continuous cycle uboot (LZMA error 1 - must reset board to recover)

Clickhouse 20.x distributed table testing and chproxy deployment (II)

Half find
![[sword finger offer] interview question 49: ugly number](/img/7a/2bc9306578530fbb5ac3b32254676d.png)
[sword finger offer] interview question 49: ugly number

centos上mysql5.7主从热备设置
随机推荐
Go language slow start - Basic built-in types
__typeof和typeof的差异
Sword finger offer 51. reverse pairs in the array
The difference between synchronized and reentrantlock
Talk about the index of interview questions
禁令之下,安防巨头海康与大华的应对之策!
A powerful web vulnerability scanning and verification tool (vulmap)
[Yunxiang book club issue 13] coding format of video files
台积电6纳米制程将于明年一季度进入试产
Under the ban, the Countermeasures of security giants Haikang and Dahua!
JS operation DOM node
CAS compares the knowledge exchanged, ABA problems, and the process of lock upgrading
网络原理(2)——网络开发
Summary of network device hard core technology insider router (Part 2)
Causes and solutions of deadlock in threads
The method of exchanging two numbers in C language
[sword finger offer] interview question 49: ugly number
Binary Insertion Sort
C language: dynamic memory function
移动端h5常见问题