Panel结构
参考weui的Panel结构
核心:定位,补充:对容器设置font-size:0,消除img下多出的3px,防止居中出现偏差。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
.flex{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}
.flex-col{-webkit-box-orient:vertical;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}
.flex-row{-webkit-box-orient:vertical;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}
.flex-1{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;}
.flex-align-center{-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;}
.flex-pack-center{-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;}
.flex-pack-justify{-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;}
body,html,ul,li,p{
margin:0;padding:0;
}
img{
display:block;
}
.box_appmsg{
padding:15px;
border:1px solid red;
}
.box_appmsg .box_hd{
font-size:0;
width: 60px;
height: 60px;
line-height: 60px;
text-align: center;
position: relative;
border:1px solid black;
}
.box_appmsg .box_thumb{
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
max-width: 100%;
max-height: 100%;
}
.list-info{
margin-left:.8em;
}
</style>
</head>
<body>
<ul>
<li class="flex flex-row flex-align-center box_appmsg">
<div class="box_hd">
<img class="box_thumb" src="http://c.hiphotos.baidu.com/image/pic/item/5366d0160924ab1835f8e0fd3cfae6cd7a890b09.jpg" alt="">
</div>
<div class="flex-1 list-info">
<p>商品</p>
<p>价格</p>
</div>
</li>
</ul>
</body>
</html>

预览:
https://besswang.github.io/Panel/index.html
拓展:
还有一种居中的方案,不过是针对文字的居中。是文字内容,不是所有的标签;
核心思想:父级:text-align:center; 子级:vertical-align:middle;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
.flex{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}
.flex-col{-webkit-box-orient:vertical;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}
.flex-row{-webkit-box-orient:vertical;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}
.flex-1{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;}
.flex-align-center{-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;}
.flex-pack-center{-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;}
.flex-pack-justify{-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;}
body,html,ul,li,p{
margin:0;padding:0;
}
img{
display:block;
}
.box_appmsg{
padding:15px;
border:1px solid red;
}
.box_appmsg .box_hd{
width: 60px;
height: 60px;
line-height: 60px;
text-align: center;
border:1px solid black;
}
.box_appmsg .box_thumb{
max-width: 100%;
max-height: 100%;
vertical-align: middle;
}
.list-info{
margin-left:.8em;
}
</style>
</head>
<body>
<ul>
<li class="flex flex-row flex-align-center box_appmsg">
<div class="box_hd">
2233
<!-- <img class="box_thumb" src="http://c.hiphotos.baidu.com/image/pic/item/5366d0160924ab1835f8e0fd3cfae6cd7a890b09.jpg" alt=""> -->
</div>
<div class="flex-1 list-info">
<p>商品</p>
<p>价格</p>
</div>
</li>
</ul>
</body>
</html>

Panel结构的更多相关文章
- Lesson5——Pandas Panel三维数据结构
pandas目录 1 简介 自 Pandas 0.25 版本后, Panel 结构已经被废弃. pd.__version__ #查看pandas版本 #'1.2.4' #或者 pd.show_vers ...
- Bootstrap3 入门实战
因为公司选择了使用BootStrap3作为项目的前台展示框架,所以花了半天时间来学习Bootstrap, 如果你是第一次听说,或者说以前听说过,但没有使用过这个框架的话,希望这篇入门实战能够让你快速掌 ...
- C++: 基于四叉树数据结构的自适应网格(初探)
C++: 基于四叉树数据结构的自适应网格 二叉树是一种典型的非线性存储数据结构,查找效率可以达到\(O(log_2N)\),同样,这类树状结构存在许多种变体,详细参考邓俊辉老师的<数据结构C++ ...
- 轻量级富文本编辑器wangEditor源码结构介绍
1. 引言 wangEditor——一款轻量级html富文本编辑器(开源软件) 网站:http://www.wangeditor.com/ demo演示:http://www.wangeditor.c ...
- NGUI创建Camera参数为Simple 2D的UI UI对象的结构UI Root(2D)
NGUI创建Camera参数为Simple 2D的UI UI对象的结构UI Root(2D) 使用NGUI创建的Camera参数为Simple 2D的UI,会在游戏的场景中生成1个名为UI Root( ...
- ExtJS MVC结构
概述 大型的应用在开发和运维上都存在着困难.应用功能的调整和开发人员的调动都会影响对项目的掌控.ExtJS4带来了一种新的应用结构.这种结构不止用于组织代码,也能有效的减少必要的代码量. 这次ExtJ ...
- 深入浅出ExtJS 第五章 树形结构
5.1 TreePanel的基本使用 //树是一种非常典型的数据结构; 5.1.1 创建一棵树 //树控件有Ext.tree.TreePanel类定义,控件的名称为TreePanel;TreePane ...
- 无废话网页重构系列——(6)HTML主干结构:站点(site)、页面(page)
本文作者:大象本文地址:http://www.cnblogs.com/daxiang/p/4653546.html 在分析和切出设计稿,以及部署项目目录文件后,开始写HTML Demo. 首先,弄出H ...
- Ext.tree.Panel Extjs 在表格中添加树结构,并实现节点移动功能
最近在用Extjs 做后台管理系统,真的非常好用.总结的东西分享一下. 先展示一下效果图 好了,开始吧! 首先说一下我的创建结构: 一.构造内容 这个函数中包括store的创建,treePanel的创 ...
随机推荐
- 非常酷的jQuery/HTML5图片滑块特效 带弹性菜单
新的一周刚刚开始,当我迷迷糊糊坐在办公桌前时,又不自主的去看了一些jQuery和HTML5的应用插件,今天我们来看一款非常酷的jQuery/HTML5图片滑块特效,这款插件的特点是图片上不错的弹性菜单 ...
- QQ彩票任意订阅内容导致骚扰用户
数据包: POST /my/index.php?mod=securityinfo&op=AjaxUpdateTipsSet HTTP/1.1 Host: 888.sports.qq.com C ...
- 加密算法(扩展知识:Base64编码)
在某些考虑数据安全的场景下,我们常常会用到加密解密.编码解码知识.比如把用户密码保存到数据库上,常用的方式是通过MD5或SHA1不可逆算法进行加密后密文保存. 这里主要介绍三种常用的加密算法: (1) ...
- Java常用数据结构之Set之TreeSet
前言 上篇文章我们分析了HashSet,它是基于HashMap实现的,那TreeSet会是怎么实现的呢?没错!和大家想的一样,它是基于TreeMap实现的.所以,TreeSet的源码也很简单,主要还是 ...
- 视觉单词模型、词袋模型BoW
多用于图像检索.分类 3.2.1.4 视觉单词模型 视觉词袋(BoVW,Bag of Visual Words)模型,是“词袋”(BoW,Bag of Words)模型从自然语言处理与分析领域向图像处 ...
- MongoDB 连接池
http://www.cnblogs.com/huangfox/archive/2012/04/01/2428947.html http://www.iteye.com/problems/97350
- android 不能在子线程中更新ui的讨论和分析
问题描写叙述 做过android开发基本都遇见过 ViewRootImpl$CalledFromWrongThreadException,上网一查,得到结果基本都是仅仅能在主线程中更改 ui.子线程要 ...
- 关联Left Outer Join的第一条记录
数据准备 CREATE TABLE person (person_id ), lastname )) / INSERT ALL INTO person (person_id, firstname, l ...
- Go之go与channel组合使用
1,等待一个事件 <-ch 将一直阻塞,直到ch被关闭 或者 ch中可以取出值 为止 所以到第17行之后会去执行go后面的func()匿名函数,在里面给ch赋值后(或者close(ch))后,才 ...
- vue实现百度搜索下拉提示功能
这段代码用到vuejs和vue-resouece.实现对接智能提示接口,并通过上下键选择提示项,按enter进行搜索 <!DOCTYPE html> <html lang=" ...