css 标签 垂直居中
<!DOCTYPE html >
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> 多行文字实现垂直居中 </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
div#wrap {
display:table;
border:1px solid #FF0099;
background-color:#FFCCFF;
width:380px;
height:200px;
_position:relative;
overflow:hidden; }
div#subwrap {
vertical-align:middle;
display:table-cell;
_position:absolute;
_top:50%;
}
div#content {
_position:relative;
_top:-50%;
}
.p{
width:200px;
height:200px;
background-color:lightblue;
display: table;
}
.c{
display: table-cell;
width:50px;
height:50px;
background-color:lightgreen;
}
</style>
</head>
<body>
<div id="wrap">
<div id="subwrap">
<div id="content">
<div style="width:100px;height:100px;background-color:black;margin:0 auto;"></div>
</div>
</div>
</div>
</body>
</html>
css 标签 垂直居中的更多相关文章
- 五种方法让CSS实现垂直居中
利用 CSS 来实现对象的垂直居中有许多不同的方法,比较难的是选择那个正确的方法.我下面说明一下我看到的好的方法和怎么来创建一个好的居中网站. 使用 CSS 实现垂直居中并不容易.有些方法在一些浏览器 ...
- CSS实现垂直居中的5种方法
利用 CSS 来实现对象的垂直居中有许多不同的方法,比较难的是选择那个正确的方法.我下面说明一下我看到的好的方法和怎么来创建一个好的居中网站. 使用 CSS 实现垂直居中并不容易.有些方法在一些浏览器 ...
- 转: css实现垂直居中的方法
利用 CSS 来实现对象的垂直居中有许多不同的方法,比较难的是选择那个正确的方法.我下面说明一下我看到的好的方法和怎么来创建一个好的居中网站. 用 CSS 实现垂直居中并不容易.有些方法在一些浏览器中 ...
- 顽石系列:CSS实现垂直居中的五种方法
顽石系列:CSS实现垂直居中的五种方法 在开发过程中,我们可能沿用或者试探性地去使用某种方法实现元素居中,但是对各种居中方法的以及使用场景很不清晰.参考的内容链接大概如下: 行内元素:https:// ...
- css 文字垂直居中问题
CSS 文字垂直居中问题 问题:在 div 中文字居中问题: 当使用 line-height:100%%; 时,文字没有居中,如下: html: <div id="header_log ...
- css标签及属性
css标签及属性 HTML引入CSS的方法 1.嵌入式 <style type = “text/css”>要写的样式</style> 2.外联式 <link rel ...
- CSS水平垂直居中总结
行内元素水平居中 把行内元素包裹在块级父元素中,且父元素中的css设置text-align:center; <!DOCTYPE html> <html> <head> ...
- css图片垂直居中
css图片垂直居中一.style代码 .case-pic{ height: 125px; position: relative; text-align: center } .case-pic span ...
- CSS标签居中
CSS标签居中是相对于父标签说的,即在父标签的中居中.通常是在子标签中使用margin:0 auto,来使子标签居中.此外子标签需要有固定的宽度才行,比如 子标签为div时,div的宽度默认占父标签的 ...
随机推荐
- ADO.NET中主要对象
ADO.NET是什么? ADO.NET是.Net平台提供和数据库交互的类库集,我们可以通过它对SQLSERVER,XML,Oracle等这样的数据源进行访问. 应用程序可以使用ADO.NET链接到数据 ...
- jade编译乱码问题
加上: meta(http-equiv="Content-Type",content="text/html; charset=utf-8")
- [LeetCode]题解(python):100 Same Tree
题目来源 https://leetcode.com/problems/same-tree/ Given two binary trees, write a function to check if t ...
- [LeetCode]题解(python):088 Merge Sorted Array
题目来源 https://leetcode.com/problems/merge-sorted-array/ Given two sorted integer arrays nums1 and num ...
- JSON.stringify实例应用—将对象转换成JSON类型进行AJAX异步传值
在上一篇中,对JSON.stringify()方法有了初步的认识,并且做了一些简单的例子.本篇将进一步将JSON.stringify用在复杂些的实例中,例如如下需求: 在进jQuery AJAX异步传 ...
- qt 屏幕旋转
qt屏幕旋转的方法 参考链接 http://mikenoodle.blog.163.com/blog/static/11333522010102754154616/ http://blog.csdn. ...
- Swift闭包
把Swift中的 block 常见的声明和写法作一个总结.以免后续忘了,好查阅. // // blockDemo.swift // swiftDemo // // Created by appl ...
- Useful bat command
1.Start and stop the windows services net stop <service name>net start <service name>net ...
- json解析转map
HashMap<String, Object> map = new HashMap<String, Object>(); JSONObject jsonObject = ...
- 更改AlertView背景
UIAlertView *theAlert = [[[UIAlertViewalloc] initWithTitle:@"Atention" message: @"I'm ...