2

我已经<div>调用了容器,它包装了几个 <div>称为块的 s,我使用了一个名为 columnizer 的 jquery 插件将块拆分为列。问题是,我似乎无法让被<div>调用的容器包装通过 div 的块.我也有图片来证明我的问题。

我尝试了很多解决方案,例如删除容器宽度,但它不起作用,因为我认为名为 columnizier 的 jquery 插件需要一个宽度。

在此处输入图像描述

我的html

<script type = "text/javascript" src ="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type = "text/javascript" src ="https://raw.github.com/adamwulf/Columnizer-jQuery-Plugin/master/src/jquery.columnizer.js"></script>

    <script type="text/javascript">
    $(function(){
        $('h1').addClass('dontend');
        $('.wide').columnize({
            width : 100,
            height : 300
        });
    });
</script>

 <script  style="display:none" type="text/javascript">var Mint=new Object();Mint.save=function()
{var now=new Date();var debug=false;if(window.location.hash=='#Mint:Debug'){debug=true;};var path='http://welcome.totheinter.net/mint/?record&key=6a56784248357a3735323031363633316663796c526d';path=path.replace(/^https?:/,window.location.protocol);for(var developer in this)
{for(var plugin in this[developer])
{if(this[developer][plugin]&&this[developer][plugin].onsave)
{path+=this[developer][plugin].onsave();};};};path+='&'+now.getTime();if(debug){window.open(path+'&debug&errors','MintLiveDebug'+now.getTime());return;};var ie=/*@cc_on!@*/0;if(!ie&&document.getElementsByTagName&&(document.createElementNS||document.createElement))
{var tag=(document.createElementNS)?document.createElementNS('http://www.w3.org/1999/xhtml','script'):document.createElement('script');tag.type='text/javascript';tag.src=path+'&serve_js';document.getElementsByTagName('head')[0].appendChild(tag);}
else if(document.write)
{document.write('<'+'script type="text/javascript" src="'+path+'&amp;serve_js"><'+'/script>');};};if(!Mint.SI){Mint.SI=new Object();}
Mint.SI.Referrer={onsave:function()
{var encoded=0;if(typeof Mint_SI_DocumentTitle=='undefined'){Mint_SI_DocumentTitle=document.title;}
else{encoded=1;};var referer=(window.decodeURI)?window.decodeURI(document.referrer):document.referrer;var resource=(window.decodeURI)?window.decodeURI(document.URL):document.URL;return '&referer='+escape(referer)+'&resource='+escape(resource)+'&resource_title='+escape(Mint_SI_DocumentTitle)+'&resource_title_encoded='+encoded;}};Mint.save();</script> 


<!DOCTYPE html>




<meta charset="utf-8" />
<link rel="stylesheet" href="b.css">



<div class="container"> <div class="wide">


    <div class="block"></div><br>
    <div class="block"></div><br>
    <div class="block"></div><br>


</div></div>

我的 CSS

.container {
    background-color: #ED8713;
    height: 300px;
    width: 200px;

}
.block {
    width: 50px;
    height:250px;
    background-color: #C31212;
    margin: 10px;
    margin-top: 5px;
}
4

1 回答 1

2

它在这里工作:http: //jsfiddle.net/gRxdF/3/

CSS:

.container {
    background-color: #ED8713;
    height: 300px;
    float: left;
}
.block {
    display: inline-block;
    height: 250px;
    background-color: #C31212;
    margin: 10px;
    margin-top: 5px;
}

HTML- 我删除了<br>标签。

于 2013-04-21T21:14:10.410 回答