gpt4 book ai didi

css - 在所有 IE 中显示 html 表单时出错

转载 作者:太空宇宙 更新时间:2023-11-03 19:34:58 25 4
gpt4 key购买 nike

我有一个代码:

<html>
<head>
<title>test</title>
<link rel="stylesheet" type="text/css" href="css/style.css" media="screen" />
</head>
<body>
<div id="main_body"></div>
</body>
</html>

和 style.css 的 css:

* {
margin: auto;
padding: 0;
}
#main_body {
width: 568px;
text-align: left;
height: 295px;
background: url(../images/form_BG.png) no-repeat left;
}

当我运行 firefox 时,结果是: enter image description here

但是在 IE 中运行时结果错误显示在左侧,而不是像 firefox 那样显示在中心 enter image description here

最佳答案

试试这个:

div {
margin: auto;
padding: 0;
}
#main_body {
width: 568px;
text-align: left;
height: 295px; background: url(../images/form_BG.png) no-repeat left; }

在所有浏览器中工作

关于css - 在所有 IE 中显示 html 表单时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9612971/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com