我正在嘗試創建一個響應式頁面,其中正方形佔用全寬度的50%(每行2個方格)。在移動(包括iPhone 6/7加),這些廣場應該是一個接一個,但下這就是它沒有用下面的代碼工作:CSS中的響應式2列正方形
.square {
width: 100vw;
height: 100vw;
float: left;
}
@media (min-width: 1170px) {
.square {width: 50vw; height: 50vw; }
}
理想情況下,我會用引導,但我想不出如何創建廣場。
你有沒有設置'HTML,身體{保證金:0}'? – LGSon
是的 - 我認爲這與智能手機的「設備 - 像素比率」有關,它使得寬度obselete的使用 – titibouboul
不,它實際上是基於視口單元不排除滾動條的事實...發佈了一個答案你 – LGSon