- <style type="text/css">
- .container{
- text-align: center;
- border: solid 1px blue;
- }
- </style>
- <div class=container>
- <table>
- <tr><td>Text</td></tr>
- </table>
- </div>
在IE下"Text"居中显示,FF下"Text"靠左显示.
二、解决问题:
方案1:
- <style type="text/css">
- .container{
- text-align: center;
- border: solid 1px blue;
- }
- table {
- margin-left:auto;
- margin-right:auto;
- }
- </style>
- <div class=container>
- <table>
- <tr><td>Text</td></tr>
- </table>
- </div>
方案2:
- <style type="text/css">
- .container{
- text-align:-moz-center; /*FF*/
- #text-align: center; /*IE */
- border: solid 1px blue;
- }
- </style>
- <div class=container>
- <table>
- <tr><td>Text</td></tr>
- </table>
- </div>
方案3:
- <style type="text/css">
- .container{
- border: solid 1px blue;
- }
- </style>
- <center>
- <div class=container>
- <table>
- <tr><td>Text</td></tr>
- </table>
- </div>
- </center>
相关推荐
复制代码代码如下: body { text-align:center; } 用ie7打开是居左的。 万能 float 闭合(非常重要!) 关于 clear float 的原理可参见 [How To Clear Floats Without Structural Markup] 将以下代码加入Global CSS 中...
谨以此篇献给那些和我一样使用 myeclipse 开发,为了在 IE 下居中一直使用 text-align:center 居中的童鞋,接下来介绍让IE也支持margin居中的实现方法
IE7下当position:fixed遇到text-align:center 的一些状况,大家可以参考下。
1.text-align: 属性规定元素中的文本的水平对齐方式; 该属性通过指定行框与哪个点对齐,从而设置块级元素内文本的水平对齐方式; 一般情况下设置文本对齐方式的时使用此属性。支持值 justify。 Example: div...
text-align:center;*z-index:1}#ftCon{height:100px;position:absolute;bottom:44px;text-align:center;width:100%;margin:0 auto;z-index:0;overflow:hidden}#ftConw{width:720px;margin:0 auto}body{font:12px ...
本文实例讲述了GridView... text-align:center; } .gvHeader { color: #3F6293; background-color: #F7F7F7; height: 24px; line-height: 24px; text-align: center; font-weight: normal; font-variant: no
text-align:center} a{color:#4D4D4D;text-decoration:none} a:hover{color:#AD0000;text-decoration:none} #menu {width:160px;margin:0px;padding:0px;text-align:left;list-style:none;border:1px solid #B0D4ED...
1、div的垂直居中问题: 解决方法:将行距增加到和整个DIV一样高: 复制代码代码如下:div{ height: 100px; line-height: 100px;...ie6下,div设置为float时,左(右)margin会加倍。 解决方法:在这个div里面加上d
主要的样式定义如下,这也是最简单的方法: body {TEXT-ALIGN: center;} #center { MARGIN-RIGHT: auto; MARGIN-LEFT: auto; } 说明: 首先在父级元素定义TEXT-ALIGN: center;这个的意思就是在父级元素内的内容居中...
<... <head> <meta charset="utf-8">...meta http-equiv="X-UA-Compatible" content="IE=edge">...meta name="viewport" content="width=device-width, initial-scale=1, maximum-...text-align: center; }
body{text-align:center} #dd{ margin:50px auto} #odiv{ width:400px; height:200px;border:1px dotted red; border:1px dashed green;} #odiv ul{ list-style:none; text-align:left; width:150px; font-size:...
text-align:center; display:block; } 实际验证结果:IE6 OK, FIREFOX 3 OK。 一、形如<span>ABC</span>DEF格式行设置SPAN为固定宽度的方法如下: span {width:60px; text-align:center; display:block; float:...
text-align:center; background: url(images/top.gif); z-index:500;} #tabs ul {padding:0; margin:0; width:400px; list-style:none; position:relative;} #tabs ul li {float:left; display:inline; width:125px...
但是值得注意的是官方介绍中已明确表态说这个插件不支持ie6,下面将提供多实例化Zero Clipboard复制功能的实现及兼容ie6的写法! 先下载ZeroClipboard //www.jb51.net/jiaoben/24961.html <style type=text/css&...
2.td text-align:center (ie 必须为td 指定宽度才居中) 3.按照星期构建表格,注意前后月边界问题 4.table ie处理问题,需要强制指定用dom操作 5.colSpan cellSpacing hideFocus (colspan cellspacing ie ...
text-align:center} .box p{line-height:20px; padding:4px 4px 10px 4px; text-align:left} .box:hover{border:1px solid #f90} .box h4{line-height:32px; font-size:14px; color:#f30;font-weight:500} .box h4 ...
IE6.0 Only 非XHTML标准,可能IE 7.0也看不了….哈哈 蓝方先走 * { font:24px arial, “宋体”; font-weight:bold; color:white; cursor:default; } table { table-layout:fixed;... text-align:center