为什么这两条线的宽度不同?它们都应该是 1px;
唯一的区别是它们的左数不同,但这为什么会导致宽度变化呢?
顺便说一下,我的chrome版本是84.0.4147.105(win10),在firefox中看起来是正确的。
body {
margin: 0;
padding: 0
}
.demo {
width: 500px;
height: 500px;
position: relative;
background-color: yellow;
}
.line, .line2 {
left: 300px;
position: absolute;
width: 1px;
background-color: red;
height: 500px;
}
.line2 {
left: 402px;
}Run Code Online (Sandbox Code Playgroud)
<div class="demo">
<div class="line"></div>
<div class="line2"></div>
</div>Run Code Online (Sandbox Code Playgroud)
在其他语言中
for?i=0; i<10; i++){
if(...){
i = 4;
}
}
Run Code Online (Sandbox Code Playgroud)
循环会上升,但在python中,它不起作用
for i in range(1, 11):
if ...:
i = 4
Run Code Online (Sandbox Code Playgroud)
那么我可以用'for'循环吗?