css

ul,li{

list-style: none;

margin: 0;

padding: 0;

background-color: #eee;

}

ul{

width: 240px; height: 240px;

}

.li{

outline: 1px solid #fff;

display: flex;

}

/* 只有一个图片 */

.li:only-child{

height: 100%;

align-items: center;

}

/* 2个图片 */

.li:first-child:nth-last-child(2), .li:first-child:nth-last-child(2) + li{

width: 50%; height: 50%;

}

.li:first-child:nth-last-child(2) + li{

margin-left: auto;

}

/* 3个图片 */

.li:first-child:nth-last-child(3), .li:first-child:nth-last-child(3) ~ li{

width: 50%;

}

.li:first-child:nth-last-child(3){

margin: auto;

}

.li:first-child:nth-last-child(3) ~ li{

float: left;

}

/* 4个图片 */

.li:first-child:nth-last-child(4), .li:first-child:nth-last-child(4) ~ li{

width: 50%;

float: left;

}

/* 5个或8个图片 */

.li:first-child:nth-last-child(5), .li:first-child:nth-last-child(5) ~ li, .li:first-child:nth-last-child(8), .li:first-child:nth-last-child(8) ~ li{

width: 33%;

float: left;

}

.li:first-child:nth-last-child(5),.li:first-child:nth-last-child(5)+li{

margin-top: 16%;

}

.li:first-child:nth-last-child(5), .li:first-child:nth-last-child(8){

margin-left: 15%;

}

/* 6个图片 */

.li:first-child:nth-last-child(6), .li:first-child:nth-last-child(6) ~ li{

width: 33%;

float: left;

}

.li:first-child:nth-last-child(6), .li:first-child:nth-last-child(6) + li, .li:first-child:nth-last-child(6) + li + li{

margin-top: 16%;

}

/* 7个图片 */

.li:first-child:nth-last-child(7), .li:first-child:nth-last-child(9), .li:first-child:nth-last-child(7) ~ li, .li:first-child:nth-last-child(9) ~ li{

width: 33%;

float: left;

}

.li:first-child:nth-last-child(7){

float: none;

margin: auto;

}

html

部分效果图:

html头像裁剪仿微信,仿微信群头像css布局相关推荐

  1. Android仿微信,QQ群头像合成

    原文地址:https://www.jb51.net/article/130296.htm 效果图: 作为程序员,首先会评估下工作量吧.在产品眼里,就是把图片合成一起嘛,有啥难度吗?所以工作时间决定了你 ...

  2. Android——仿钉钉,微信,QQ群头像

    效果 功能 生成类似钉钉.微信 群聊组合头像Bitmap 多图拼接展示(目前最多支持九张图) 可图文混合展示 可展示成圆角.方角.圆形 可自定义分割线宽度.颜色.背景色.文字大小颜色等 实现 attr ...

  3. 头像裁剪上传_微信新功能:11月微信新玩法!给微信换上“皇冠头像”,还能加姓氏?...

    阅读本文前,请您先点击上面的蓝色字体"电影收录达人",再点击"关注",这样您就可以继续免费收到文章了.每天都有分享,完全是免费订阅,请放心关注. 声明:图文来源 ...

  4. 电商项目:仿小米官网纯HTML+css布局

    前言 时间过得很快,已经步入大三下学期了,浪了大学这几年,这几个星期从新把之前学的html+css系统性复习了一遍,虽然之前也学习过,但Monto觉得无论任何事情,基础是最重要的,任何框架千变万变,但 ...

  5. canvas仿知乎头像裁剪

    canvas实现图片裁剪, <head lang="en"><meta charset="UTF-8"><title>仿知乎 ...

  6. 头像裁剪和Uncaught DOMException: Failed to execute ‘toDataURL‘ on ‘HTMLCanvasElement‘: Tainted canvases m

    此文是半原创. 头像裁剪的主要实现是同事找来发我的,用着还不错. 记一下,可以用作以后研究. 此文主要记录一个要点: 当用户上传已上传头像,裁剪头像弹窗获取到图片,当调用canvas的toDataUR ...

  7. php 合成微信头像,PHP 图片合成、仿微信群头像的方法示例

    搜索热词 本文实例讲述了PHP 图片合成.仿微信群头像的方法.分享给大家供大家参考,具体如下: 参考文章: 作者:凯歌~,PHP图片合成方法(多张图片合成一张)https://www.jb51.net ...

  8. Android高仿微信头像裁剪

    最近公司的APP很多用户反应无法上传头像,于是打算修改原来头像裁剪的代码.参考微信.QQ.唱吧头像裁剪的操作,决定就仿微信头像裁剪来上传用户头像,在Android大神鸿洋的一篇高仿微信头像的博客(博客 ...

  9. java 头像 微信群_仿微信群头像九宫格控件 LQRNineGridImageView

    软件介绍 仿微信群头像九宫格控件 一.简介: 参照Android 仿微信群聊头像文章学习开发的一个仿微信群头像九宫格控件,感谢博主Loften_93663469. 效果如下: 二.使用: 1.在自己项 ...

  10. Android仿微信QQ群头像生成

    先上效果图 qq效果的图片是在github上找的项目 https://github.com/kongnanlive/android-combination-avatar 仿微信群头像是自己鼓捣出来的 ...

最新文章

  1. uniapp 鸿蒙,关于前端:uniapp项目安装运行操作手册
  2. php实现项目的日志记录功能,tp5框架使用composer实现日志记录功能示例
  3. python中几种交换2个变量的值的方法
  4. 使用mybatis向oracle数据库插入数据异常
  5. 全国人工智能大赛 行人重识别(Person ReID)赛项 季军团队方案分享
  6. P4719-[模板]动态DP【矩阵乘法,树链剖分,线段树】
  7. leetcode52. N皇后 II 最强解法直接秒杀100%
  8. 论文浅尝 | IRW:基于知识图谱和关系推理的视觉叙事框架
  9. 事物与持久化_跟面试官侃半小时MySQL事务,说完原子性、一致性、持久性的实现...
  10. 驯龙大师稳了!iQOO Neo6游戏实测:两款手游均接近满帧
  11. AD域环境的搭建 基于Server 2008 R2
  12. qtextedit非编辑时去边框_10分钟看懂Photoshop图像的基本编辑方法-数字化图像、图像基础理论知识(置入文件)...
  13. js基础-23-websocket和ajax的区别
  14. 将DW数据窗口导出为EXCEL文件的方法(整理)
  15. 流畅的python是python3吗_流畅的 Python - 3. 文本与
  16. 【SequoiaDB|巨杉数据库】巨杉数据库快速入门
  17. 解决VS 2017/2019社区版无法登陆的方法
  18. windbg内核诊断方式--转载
  19. excel计算机课程表,Excel如何制作课程表
  20. LabVIEW控制Arduino采集多路模拟量、数字量(进阶篇—1)

热门文章

  1. 【嵌入式系统】STM32时钟系统+时钟配置函数解析
  2. SQL Server的Descending Indexes降序索引
  3. 【阿里云服务器】ECS云服务器新手上路
  4. python编程游戏-9个Python编程小游戏,有趣又好玩,简直太棒了
  5. numpy学习线性回归, 并用matplotlib画动态图
  6. vue图片加载不出来的问题
  7. 园区人工智能开启双创模式,“1+N”创新型组织发展成效初显...
  8. 提醒:无线路由曝安全漏洞,请关闭WPS功能
  9. 有太多工作要做,传蚂蚁集团IPO可能推迟至2022年
  10. 条形码和区块链将彻底改变零售业