常用布局,div竖直居中
常用两列布局,多列布局和div竖直居中
body {
margin:;
padding:; }
.w200 {
width: 200px; }
.mar-left200 {
margin-left: 200px; }
.red {
background-color: red; }
.middle {
vertical-align: middle; }
.block {
width: 80%;
height: 300px;
border: 1px solid #eee;
margin: 0 auto; }
.content {
width: 300px;
height: 100px;
background-color: #E1F9FF; }
.clearfix {
*zoom:; }
.clearfix:before, .clearfix:after {
content: '';
display: table; }
.clearfix:after {
clear: both; }
.layout-inline div, .layout-inline span {
width: 200px;
height: 300px;
line-height: 40px;
display: inline-block;
background-color: #E6E6FA; }
.layout-float div {
float: left;
word-break: break-all;
height: 100%; }
.layout-position .absolute {
position: absolute;
height: 300px; }
.layout-table {
display: table; }
.layout-table div {
display: table-cell;
text-align: center; }
.ver-position {
border: 1px solid #eee;
position: relative; }
.ver-position div {
margin: auto;
position: absolute;
left:;
right:;
top:;
bottom:; }
.ver-position label {
background-color: #E1F9FF;
position: absolute;
left: 50%;
margin-left: -150px;
right:;
top: 50%;
margin-top: -50px;
bottom:; }
.floater {
float: left;
height: 50%;
margin-bottom: -50px; }
.cont {
clear: both;
position: relative;
margin: auto; }
/*# sourceMappingURL=index.css.map */
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>常用布局</title>
<link href="index.css" rel="stylesheet"/>
</head>
<body>
<section class="block layout-inline">
<div>lalala</div><!--
--><div>lalala</div><!--
--><div>lalala</div>
</section>
<div class="block layout-float clearfix">
<div class="w200 red">11111111111</div>
<div>2222222</div>
</div>
<div class="block layout-position">
<div class="w200 absolute red">11111111111</div>
<div class="mar-left200">2222222</div>
</div>
<div class="block layout-table">
<div class=" w200 red">11111111111</div>
<div>222222222</div>
<div>33333333333</div>
</div>
<div class="block ver-position">
<div class="content">111111111111111111</div>
</div>
<div class="block ver-position">
<label class="content">22222</label>
</div>
<div class="block ">
<div class="floater">
</div>
<div class="content cont">Content here</div>
</div>
<div class="block layout-table">
<div class="content middle">111</div>
</div> </body>
</html>
常用布局,div竖直居中的更多相关文章
- css水平居中,竖直居中技巧(二)
css水平居中,竖直居中技巧(二)===### 1.效果 ### 2.代码#### 2.1.index.html <!DOCTYPE html> <html lang="z ...
- css水平居中,竖直居中技巧(一)
css水平居中,竖直居中技巧(一)===### 1.效果 ### 2.代码#### 2.1.index.html <!DOCTYPE html> <html lang="z ...
- 水平/竖直居中在旧版Safari上的bug
今天调了两个出现在旧版Safari上的layout bug. 它们最初是在同事的iPad上被发现的, 我在自己桌面上安装的Safari 5.1.7上也能够复现. Bug1: .vertical-cen ...
- css水平竖直居中方式
CSS水平和垂直居中的几种实现方法: 1.单行垂直居中 文字在层中垂直居中vertical-align 属性是做不到的.我们这里有个比较巧妙的方法就是:设置height的高度与line-height的 ...
- html的a标签display:block之后文字竖直居中
设置行高和a标签的高度一样就能居中,使用line-height
- html 水平竖直居中
line-height:容器高度 <!DOCTYPE html> <html lang="en"> <head> <meta charse ...
- UITextField竖直居中对齐
http://blog.sina.com.cn/s/blog_87533a0801012nv0.html 用xib生成的UITextField文字默认是水平左对齐,垂直居中对齐的,但是用代码生成的UI ...
- CSS -- 文字竖直居中
元素的height 和 lineheight 设置为一样即可.
- Vertical Center TextView . 竖直居中的UITextView
@interface VerticalCenterTextView : UITextView @end @implementation VerticalCenterTextView - (void) ...
随机推荐
- STM32启动文件的选择
移植了同事一个程序,然后死活不能用,发现启动文件错了,明天继续调.真把人折腾死了. stm32给的库文件太琐碎了,正如它的芯片型号一样繁多,例如启动文件: 网上查到的各个文件的解释是: startup ...
- 转: Linux C 动态内存分配 malloc及相关内容 .
一.malloc()和free()的基本概念以及基本用法: 1.函数原型及说明: void *malloc(long NumBytes):该函数分配了NumBytes个字节,并返回了指向这块内存的指针 ...
- BZOJ 3196 二逼平衡树
Description 您需要写一种数据结构(可参考题目标题),来维护一个有序数列,其中需要提供以下操作:1.查询k在区间内的排名2.查询区间内排名为k的值3.修改某一位值上的数值4.查询k在区间内的 ...
- hdu 5147 Sequence II
http://acm.hdu.edu.cn/showproblem.php?pid=5147 题意:问有多少个这样的四元组(a,b,c,d),满足条件是 1<=a<b<c<d; ...
- 转:阿里旺旺导致python安装包失败的解决办法
我以前使用web.py没事,今天运行时报错, mimetypes.init() # try to read system mime.types File "D:\ProgramFiles\p ...
- dns智能解析对网站排名的影响
网站排名是所有建站者都关系的问题,如何提升网站排名有很多因素,网站是否健康也与网站排名有关,下面智儒科技网站建设为你研究下如何判断自己的网站是否健康. 一般情况下,网站的排名在优化的基础上,怎么也上不 ...
- struts2的action访问servlet API的三种方法
学IT技术,就是要学习... 今天无聊看看struts2,发现struts2的action访问servlet API的三种方法: 1.Struts2提供的ActionContext类 Object g ...
- c++子类继承父类的覆盖问题
废话少说,先看一段代码! #include <iostream> #include <string> using namespace std; class A { public ...
- Android常用的一些make命令(转载)--不错
原文网址:http://blog.sina.com.cn/s/blog_abc7e49a01011y0n.html 1.make -jXX XX表示数字,这个命令将编译Android系统并生成镜像, ...
- 【转】Javabyte[]数组和十六进制String之间的转换Util------包含案例和代码
原文网址:http://blog.csdn.net/caijunjun1006/article/details/11740223 Java中byte用二进制表示占用8位,而我们知道16进制的每个字符需 ...