Div不是以Firefox为中心但在IE中却很好? [英] Div not centering in Firefox but fine in IE ?
问题描述
我是小组的新手,我正在为我正在做的页面有问题
艺术家们。这是我第一次涉足样式表。
这里有问题:我想潜水,我想集中。我使用下面的
代码创建了一个以页面为中心的div。它适用于IE
位在Firefox Mozilla等中不起作用。
这里是代码
body {
text-align:center;
font-color:#ffffff;
background-image:URL(gothclub.jpg) ;
}
div {
text-align:center;
填充:5px;
padding-top:10px;
margin-top:10px;
保证金:左:20%;
宽度:60 %;
颜色:sienna;
背景颜色:#330000;
border:1px#82543d solid
}
任何帮助将不胜感激。
戴夫
da ************* @ gmail.com 写道:我是小组的新手,我正在为一个页面问题,我正在做一个艺术家的篝火。这是我第一次涉足样式表。
这里的问题是:我想要潜水,我想集中注意力。我使用下面的
代码创建了一个以页面为中心的div。它在IE中工作
位在Firefox Mozilla等中不起作用。
这里的代码
body {
text-align:center ;
font-color:#ffffff;
background-image:URL(gothclub.jpg);
}
以中心为中心一个块你应该设置margin-left和margin-right
到auto,但IE不尊重这个,所以你必须使用
text-align :中心让IE开心,加上margin-left:auto;
margin-right:auto用于符合标准的浏览器。
为什么我不惊讶IE不兼容?非常感谢你的提示
就像一个冠军!
Dave
< blockquote> CA Upsdell>写道:
要设置一个块,你应该设置margin-left和margin-right
为auto,但IE不尊重这个,
IE6在标准模式下确实如此。
text-align:center让IE开心,
更具体地说,IE5.x或IE6处于怪癖模式(无论如何你都不应该触发
)。
-
回复电子邮件地址是无底垃圾邮件桶。
请回复群组,以便每个人都可以分享。
Hi I''m new to group and I''m having an issue with a page I''m doing for
an Artist firend. This is my first foray into stylesheets.
here''s the problem: I''ve got a dive I would like centered. I use the
code below to created a div that''s centerd on the page. It works in IE
bit does not work in Firefox Mozilla etc.
here''s the code
body{
text-align:center;
font-color:#ffffff;
background-image:URL(gothclub.jpg);
}
div{
text-align:center;
padding:5px;
padding-top:10px;
margin-top:10px;
margin:left:20%;
width:60%;
color:sienna;
background-color:#330000;
border:1px #82543d solid
}
Any help will be appreciated.
Dave
da*************@gmail.com wrote:Hi I''m new to group and I''m having an issue with a page I''m doing for
an Artist firend. This is my first foray into stylesheets.
here''s the problem: I''ve got a dive I would like centered. I use the
code below to created a div that''s centerd on the page. It works in IE
bit does not work in Firefox Mozilla etc.
here''s the code
body{
text-align:center;
font-color:#ffffff;
background-image:URL(gothclub.jpg);
}
To centre a block you are supposed to set margin-left and margin-right
to auto, but IE doesn''t honour this, so you have to use
text-align:center to make IE happy, plus margin-left:auto;
margin-right:auto for the standards compliant browsers.
Why am I not suprised IE is not compliant ? Well thanks for the tip it
worked like a champ !!
Dave
C A Upsdell > wrote:
To centre a block you are supposed to set margin-left and margin-right
to auto, but IE doesn''t honour this,
IE6 in standards mode does, for sure.
text-align:center to make IE happy,
More specifically, IE5.x or IE6 in quirks mode (which you shouldn''t be
triggering, anyway).
--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
这篇关于Div不是以Firefox为中心但在IE中却很好?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!