當我的網頁在移動設備上查看時,我的網頁上存在一個問題,該問題涉及柔性盒旁邊的邊距彈出。我已經將問題歸結爲一些非常簡單的代碼。在移動設備上查看柔性盒之間的不需要的餘量
HTML代碼
<html>
<head>
<link href="style.css" rel="stylesheet">
</head>
<body>
<div class="container">
<!-- When you remove this period, issue goes away -->
.
<div class="smallboxes">
<div class="smallbox1">
</div>
<div class="smallbox2">
</div>
</div>
<div class="bigbox">
</div>
</div>
</body>
</html>
CSS代碼
.container {
display: flex;
height: 100px;
}
.bigbox {
flex: 2;
background-color: #6e6e6e;
display: flex;
}
.smallboxes {
flex: 1;
display: flex;
flex-direction: column;
}
.smallbox1 {
flex: 2;
background-color: #6e6e6e;
}
.smallbox2 {
flex: 1;
}
當您運行在Chrome的代碼中,單擊鼠標右鍵,單擊 「檢查」,查看由於iPad在水平模式Pro和更改視圖到75%或125%。你會在兩個盒子之間看到一條白線。這也顯示在我的Note 5上。兩個灰色框之間不應該有線。
正如我在代碼中提到的那樣,當您刪除句點時,問題就會消失。
非常感謝您的幫助!
P.S.我是新來的,似乎無法弄清楚如何插入「在此代碼上運行代碼」按鈕。我還包括一個鏈接到codepen版本。
http://codepen.io/jasonhoward64/pen/XMpYXJ
我已經在我的三星注5:它的行爲完全像在iPad上的PC的Chrome瀏覽器模式表示測試這一點。這似乎只是一個手機問題。 –
我剛剛注意到你的看法變回了100%。如果從水平向縱向翻轉後將其更改爲75%或125%,則會發現問題仍然存在。 –
檢查我的新答案:) –