【发布时间】:2015-06-11 13:49:09
【问题描述】:
我正在尝试创建一个没有左右外边界的单像素边界同位素布局。如果您查看以下网址:
http://codepen.io/ashhitch/pen/zGwYXR/
你会看到我已经很接近了,只是有些边框没有对齐。
这是迄今为止的 LESS/CSS:
* {
box-sizing: border-box;
}
body {
font-family: sans-serif;
}
/* ---- grid ---- */
.grid {
background: #DDD;
position:relative;
border-top: solid 1px #fff;
border-top: 1px solid #333;
overflow: hidden;
&-item {
padding: 20px;
background-color: #ccc;
width: 25%;
width: ~"calc(25% + 2px)";
height: 350px;
border: 1px solid #333;
border-top: 0;
margin-right: -1px;
margin-left: -1px;
&:last-child {
border-bottom: 1px solid #333;
}
}
}
.grid-item--height2 { height:450px; }
还有 JS
$(function() {
$('.grid').isotope({
layoutMode: 'packery',
itemSelector: '.grid-item',
packery: {
gutter: 0
}
});
});
【问题讨论】:
标签: javascript jquery css jquery-isotope masonry