我有类似的设置;这是基础知识。它可能会使用一些清理,因为我基于模板(目前我似乎找不到,抱歉!)请注意,我在侧边栏没有一直向下延伸时遇到了一些困难;我能够解决这个问题,因为它在我的页面上处于固定位置,但如果您希望侧边栏滚动,这可能是一个问题。这个例子的侧边栏在右边,砌体在左边,但它可以去任何一种方式。如果您确实在右侧有侧边栏,您可能希望通过在“itemSelector:'.post'”之后添加“isRTL:true”来更改您的砌体以向右折叠。
HTML:
<center>
<div class="main">
<div id="fixed-left"></div>
<div id="fixed-sidebar"> Your tweets </div>
<div id="fixed-right"></div>
<div id="fluid">
<div id="posts"> Masonry grid </div>
</div>
</div>
</center>
CSS:
.main {
position: relative;
display: block;
width: 96%;
text-align: left;
margin: 0 auto;
}
#fixed-left { /*-- this div is probably unnecessary, I just keep it in case I want to add a column --*/
float: left;
display: inline;
width: 0;
}
#fixed-sidebar {
float: right; /*-- float: left if you want your sidebar to the left --*/
display: inline;
height: 100%;
width: 250px;
}
#fixed-right { /*-- this div is probably unnecessary, I just keep it in case I want to add a column --*/
float: right;
display: inline;
width: 0;
}
#fluid {
float: none;
height: 100%;
width: auto;
margin-right: 250px; /*-- same value as fixed-sidebar width; use margin-left if you want your sidebar to the left --*/
}
希望这对你有帮助!