div布局
来源:互联网 发布:金凯度 知乎 编辑:程序博客网 时间:2024/06/05 00:54
div水平垂直居中布局
方案一
<html><head><meta http-equiv = "Content-Type" content= "text/html;charset=utf-8"></meta><style> .box{ position:relative; width:400px; height:200px; background-color:grey; } .con{ position:absolute; transform: translate(50px,10px); width:300px; height:180px; background-color:yellow; }</style></head><body><div class="box"><div class="con"></div></div></body></html>
方案二
.con{ position:absolute; top:50%; left:50%; width:300px; height:180px; transform:translate(-50%,-50%); background-color:yellow; }
div品字形布局
代码
<html> <head> <meta http-equiv= "Content-Type" content= "text/html;charset=utf-8"></meta> <style> .box { position:relative; } .head { border:4px; border-color:blue; border-style:solid; width:400px; height:100px; position:relative; } .left { border-width: 0px 4px 4px 4px; border-color:blue; border-style:solid; width:198px; height:100px; background-color:grey; position:absolute; } .content { border-width: 0px 4px 4px 0px; border-color:blue; border-style:solid; width:198px; height:100px; background-color:green; position:absolute; left:206px; } </style> </head> <body> <div class="box"> <div class = 'head'>head</div> <div class = 'left'>left</div> <div class = 'content'>content</div> </div> </body> </html>
阅读全文
0 0
- div布局
- div布局
- div布局
- div布局
- 布局div
- div布局
- 布局div
- div布局
- DIV布局
- div布局
- div布局
- 网页布局(div布局)
- DIV+CSS DIV居中布局
- Div布局与Table布局
- HTML布局----div布局&&table
- Div+Css布局--frameSet布局
- CSS+DIV 布局 (流体布局&刚性布局)
- div+css布局入门
- C#lock 的string String.Intern 方法
- Hamming Distance
- Java类加载机制
- Python数据库(MySQL、MongoDB、Redis)编程
- BZOJ4378: [POI2015]Logistyka
- div布局
- 【JavaScript学习】面向对象的程序设计(6):原型式继承
- 基于github或者码云平台的使用git提交,下载,更新项目
- ThinkPHP 配置数据库文件
- Android 开发者的进阶之路
- Unknown bottom blob 'data' (layer 'conv1', bottom index 0)
- concurrent学习笔记
- TCP协议中的三次握手和四次挥手
- 转载sql中的group by 用法解析