第一次做不等宽不等高的瀑布流布局,刚开始企图用ccs3的column属性+flexbox来实现,瞎捣鼓半天都没有能弄好,

弱鸡哭晕在厕所(┬_┬),气的午饭都没有吃.

后来逼着自己冷静下来,又捣鼓了1个小时,终于搞定了!!!长舒一口气(๑•ᴗ•๑)把代码分享给大家,希望能帮到小白:-D

  • 最终效果如下:

  • html基本布局如下:

<body>
<div class="container">
<div class="box box0">
<span class="item"></span>
<div class="boxcontainer">
<div class="box box01">
<span class="item"></span>
<span class="item"></span>
<span class="item"></span>
<span class="item"></span>
<span class="item"></span>
</div>
<div class="box box02">
<span class="item"></span>
<span class="item"></span>
<span class="item"></span>
<span class="item"></span>
</div>
</div> </div>
<div class="box box2">
<span class="item"></span>
<span class="item"></span>
<span class="item"></span>
<span class="item"></span>
<span class="item"></span>
<span class="item"></span>
</div>
<div class="box box3">
<span class="item"></span>
<span class="item"></span>
<span class="item"></span>
</div>
</div> </body>
  • css样式如下:
<style>
.container{
width: 710px;
height: 1000px;
margin: 50px auto;
background-color: #eee;
display: flex;
flex-flow:row nowrap;
justify-content:space-between;
box-sizing:border-box;
padding: 10px;
}
.box{
box-sizing:border-box;
}
.box span{
display: block;
margin-bottom: 10px;
width: 160px;
box-sizing:border-box;
}
.box0 span{
width: 330px;
height: 150px;
background-color: blue;
}
.boxcontainer{
width: 330px;
display: flex;
flex-flow:row wrap;
justify-content:space-between;
}
.boxcontainer span{
width: 160px;
background-color: orange;
}
.boxcontainer .box01 span{
height: 80px;
background-color: purple;
}
.boxcontainer .box02 span{
height: 160px;
}
.box2 span{
height: 100px;
background-color: green;
}
.box3 span{
height: 200px;
background-color: pink;
} </style>

flexbox实现不等宽不等高的瀑布流布局的更多相关文章

  1. Ajax+json+jquery实现无限瀑布流布局

    <!doctype html> <html> <head> <meta charset="utf-8"> <title> ...

  2. AJAX+json+jquery实现预加载瀑布流布局

    宽度是一定的高度不定的瀑布流布局 也可以说是无缝拼图 当浏览器滚动到底部时候自动加载图片 加载的图片地址用json 在img.js里 ,还有正在加载动画是用 css3制作的 在ff等支持css3可以显 ...

  3. 获取jsp页面的宽和高

    var winWidth; var winHeight; function getResult() { if(window.innerWidth) { winWidth=window.innerWid ...

  4. StringGrid 实例3: 本例功能: 1、修改 TStringGrid的默认宽与高; 2、添加行; 3、确认当前单元并赋值.

    实例3: 本例功能: 1.修改 TStringGrid的默认宽与高; 2.添加行; 3.确认当前单元并赋值. 实例图形:

  5. Android中获取图片的宽和高

    在Android中,我们想获取图片的宽和高应该怎么办?一.正常加载图片的方法下获取宽和高 举一个简单的例子:创建一个图片的副本 //加载原图 Bitmap bmSrc = BitmapFactory. ...

  6. 【转】Android 获得view的宽和高

     转自:http://blog.csdn.net/yangdeli888/article/details/25405263 Android 获得view的宽和高 分类: android 技术点项目20 ...

  7. [BS-01] 根据字符串对象的参数自动计算用来显示该字符串的UI控件的宽和高

    根据字符串对象的参数自动计算用来显示该字符串的UI控件的宽和高 1.  影响昵称Label的高和宽的因素: 字体和字号大小.文字多少.高度取决于是否固定了宽度(是否限制了最大的宽度和高度) 2. 使用 ...

  8. iOS 修改网络图片的大小 宽和高

    //image宽和高 好用 NSString *strTemplateHTML = [NSString stringWithFormat:@"<html><head> ...

  9. C# 上传图片前判断上传图片的宽和高

    网上找了好久没有找到... 最后百度到了这句话“由上传的HttpPostFile的InputStream创建一个Image对象,然后想怎么处置就随便你了”. HTML代码: <asp:FileU ...

随机推荐

  1. iOS - Safe iOS 加密安全

    1.Base64 编码 简介: Base64 是一种基于64个可打印字符来表示二进制数据的表示方法,可打印字符包括字母 A-Z.a-z.0-9,共 62 个字符,另外两个符号在不同的系统不同 +,/. ...

  2. 关于HTML5音频——audio标签和Web Audio API各平台浏览器的支持情况

    对比audio标签 和 Web Audio API 各平台浏览器的支持情况:   audio element Web Audio API desktop browsers Chrome 14 Yes  ...

  3. OSChina码云试用

    首先在码云申请账户. 从 http://git-scm.com/download  下载window版的客户端.下载好,一步一步安装即可. $git config --global user.name ...

  4. Linux ftp 使用

    FTP 是File Transfer Protocol(文件传输协议)的英文简称,而中文简称为“文传协议”.用于Internet上的控制文件的双向传输.同时,它也是一个应用程序(Application ...

  5. iOS开发 获取状态栏的点击事件

    首先我们追踪UIStatusBar的触摸事件,需要在AppDelegate里面加入以下代码 - (void)touchesBegan:(NSSet *)touches withEvent:(UIEve ...

  6. usb中的传输模式

    别人总结的一个usb传输模式,保存一下 usb中的endpoint(端点)和传输模式 端点: 端点位于USB 外设内部,所有通信数据的来源或目的都基于这些端点,是一个可寻址的FIFO. 每个USB 外 ...

  7. IaaS/PaaS/SaaS

    如果你是一个网站站长,想要建立一个网站.不采用云服务,你所需要的投入大概是:买服务器,安装服务器软件,编写网站程序.现在你追随潮流,采用流行的云计算,如果你采用IaaS服务,那么意味着你就不用自己买服 ...

  8. centos6.5下安装qq2012

    大家如果想在linux下用QQ的话,最好的方法就是用wine来安装.腾讯的QQ for linux用起来很坑爹. 下面就是我用wine在centOS下安装QQ.中间过程很简单. 一.安装Wine. 1 ...

  9. 7 -- Spring的基本用法 -- 4...

    7.4 使用 Spring 容器 Spring 有两个核心接口:BeanFactory 和 ApplicationContext,其中ApplicationContext 是 BeanFactory ...

  10. ubuntu16.04安装jdk,tomcat

    ubuntu16.04安装jdk,tomcat 最近装了一下tomcat,网上的教程很多,我也试了很多次,但是有一些教程关于tomcat配置是错误的,让我走上了歧途.差点重装系统,还好王总及时出手帮助 ...