[英]Margin: 0 auto not working IE?
I have a site - http://81.201.129.45/~nichol/ which is working fine in firefox and safari but in IE the margin: 0 auto set on the containers isn't working and the site is just display as left aligned. 我有一个站点-http://81.201.129.45/~nichol/ ,它在Firefox和Safari中工作正常,但在IE中的余量为:容器上的0自动设置无效,该站点仅显示为左对齐。
Any ideas? 有任何想法吗?
You're not including a DOCTYPE in your page, include that and it works fine: 您没有在页面中包含DOCTYPE,可以添加它,并且效果很好:
<!DOCTYPE html>
EDIT: Your DOCTYPE is in place, now that i look at the source, but you're including a large chunk of javascript that is supposed to be placed inside of your head
tag, the DOCTYPE needs to be absolutely at the top. 编辑:您的DOCTYPE已经到位,现在我看一下源代码,但是您要包含一大堆应该放置在
head
标记内的javascript,因此DOCTYPE必须绝对位于顶部。
Your document seems to be on Quirks mode. 您的文档似乎处于Quirks模式。 Try specifying explicitly the document type at the top
尝试在顶部明确指定文档类型
哇,您实际上在<html>
之前有<script>
元素...将其移到</head>
之前,应该没问题。
您是否尝试在文档类型之前删除JavaScript代码?
Remove the below script from top of the page and put it in head tag. 从页面顶部删除以下脚本,并将其放在head标签中。 You site is in quirks mode.
您的网站处于怪异模式。
<script type="text/javascript">
function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
{
alert(alerttxt);return false;
}
else
{
return true;
}
}
}
function validate_email(field,alerttxt)
{
with (field)
{
apos=value.indexOf("@");
dotpos=value.lastIndexOf(".");
if (apos<1||dotpos-apos<2)
{alert(alerttxt);return false;}
else {return true;}
}
}
function validate_number(field,alerttxt)
{
with (field)
{
if (value != '11')
{
alert(alerttxt);return false;}
else {return true;}
}
}
function validate_form(thisform)
{
with (thisform)
{
if (validate_required(request_name,"Name must be filled out!")==false)
{request_name.focus();return false;}
if (validate_required(request_email,"Email address must be entered!")==false)
{request_email.focus();return false;}
if (validate_email(request_email,"Not a valid e-mail address!")==false)
{request_email.focus();return false;}
if (validate_number(request_number,"Not the correct answer for 7 + 4")==false)
{request_number.focus();return false;}
}
}
</script>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.