常用布局,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) ...
随机推荐
- bzoj3140: [Hnoi2013]消毒
Description 最近在生物实验室工作的小T遇到了大麻烦. 由于实验室最近升级的缘故,他的分格实验皿是一个长方体,其尺寸为a*b*c,a.b.c 均为正整数.为了实验的方便,它被划分为a*b*c ...
- 12.HTML编辑器(CKEditor、CKFinder集成)
CKEditor原名为FckEditor,是著名的HTML编辑器,可以在线编辑HTML内容. 配置参考文档:主要将ckeditor中的lang.plugins.skins.ckeditor.js.co ...
- org.springframework.beans.BeanUtils
org.springframework.beans.BeanUtils的一个demo.可以很优雅的实现将父类字段的值copy到子类中 下面例子的输出结果(子类使用父类的toString方法,有点意思吧 ...
- javascript 路线整理
前端开发很重要,编写脚本也不容易. 总结我以前的前端学习经历,基本是一团乱麻:css+javascript是在大三自学的,当时自己做课程设计,逼着自己在一个月之内,写了一个半成品的j2ee网站.当时, ...
- wpa_supplicant使用笔记-wpa_cli iwconfig
还在搞8634,看不到头了..唉.wireless_tools的缺点是不支持WPA认证,所以有必要把wpa_supplicant也移植过来.无线 网卡是基于zydas芯片的,正好可以在网上搜到wpa_ ...
- 【动态规划】【归并】Vijos P1412 多人背包
题目链接: https://vijos.org/p/1412 题目大意: 求01背包的前K优解,要求必须装满(1<=K<=50 0<=V<=5000 1<=N<=2 ...
- Oracle用户管理
创建用户 概述:在oracle中要创建一个新的用户使用create user 语句,一般是具有dba(数据库管理员)的权限才能使用. create user 用户名 identified by 密码: ...
- 保留n位四舍五入小数
一:可选择保留位数,注释很解释的很详细,上图 二:全部代码 using System; using System.Collections.Generic; using System.Component ...
- [Audio processing] 常见语音特征 —— LPC
共振峰产生的原理及其在音质上的体现,共振峰的分布位置是建立在声音产生媒介的共鸣物理结构基础上的(Resonant Physical Structure). 无论是人声还是乐器,它们的声音特性都源自 ...
- libvirt基于安装