【发布时间】:2018-10-10 17:20:54
【问题描述】:
需要显示一个网格布局系统3 by 3 row and column card>=990px。在>=760pxThis one screenshot 之后<760This screenshot。
但是,我尝试了下面的代码 sn-p:
<div id="plat-listing-main">
<div class="section group">
<div class="col span_1_of_3">
This is column 1
</div>
<div class="col span_1_of_3">
This is column 2
</div>
<div class="col span_1_of_3">
This is column 3
</div>
</div>
</div>
CSS:
/* SECTIONS */
.section {
clear: both;
padding: 0px;
margin: 0px;
}
/* COLUMN SETUP */
.col {
display: block;
float:left;
margin: 1% 0 1% 1.6%;
}
.col:first-child { margin-left: 0; }
/* GROUPING */
.group:before,
.group:after {
content:"";
display:table;
}
.group:after {
clear:both;
}
.group {
zoom:1; /* For IE 6/7 */
}
/* GRID OF THREE */
.span_1_of_3 {
width: 32.2%;
height: 200px;
background-color: red;
}
/* GRID OF THREE */
.span_3_of_3 {
width: 100%;
}
.span_2_of_3 {
width: 66.1%;
}
/* .span_1_of_3 {
width: 32.2%;
} */
/* GO FULL WIDTH AT LESS THAN 480 PIXELS */
@media only screen and (max-width: 990px) {
.col { margin: 1% 0 1% 1.6%;}
.span_1_of_3 { width: 49.2%; }
}
@media screen and (max-width: 760px) {
.col { margin: 1% 0 1% 1.6%;}
.span_1_of_3 { width: 100%; }
}
需要使这个网格尽可能地响应。不想为了学习目的而使用 Bootstrap 或任何其他框架。
我们将不胜感激!
【问题讨论】:
标签: javascript html css gridview layout