我正在研究一個需要響應的圖片div鑽石項目。如何創建響應式4格鑽石?
下圖顯示了我創建的div中的鑽石,但它不適用於所有尺寸。我希望鑽石對瀏覽器尺寸作出反應,所以它總是適合的。
我有a jsFiddle,但它不響應。只是爲了展示我想要的,我一直在努力創造。
<div id="page">
<div id="main">
<div class="box blue"></div>
<div class="box green"></div>
<div class="box red"></div>
<div class="box yellow"></div>
</div>
</div>
#page {
width:100%;
height:100%;
min-height:500px;
min-width:500px;
}
#main {
height:80px;
width:80px;
position:relative;
display:block;
transform: rotate(45deg);
-ms-transform: rotate(45deg); /* IE 9 */
-webkit-transform: rotate(45deg); /* Safari and Chrome */
}
.box {
display: inline-block;
height:35%;
width:35%;
margin-right:5%;
margin-top:5%;
}
.blue {
background-color:blue;
}
.green {
background-color:green;
}
.red {
background-color:red;
}
.yellow {
background-color:#ffd54f;
}
任何幫助是非常讚賞:-)
我們能有什麼是應該的屏幕來界定呢?你的例子有空文本,並沒有打印任何東西,所以我不確定你的意思是「鑽石」 –
我在截圖中添加了我到目前爲止的內容。 –
嗯好吧,我想你可能會考慮測試firefox上的所有內容,或者這只是我的一個問題? –