gpt4 book ai didi

html - 尽管使用边距 : 0 auto,但 Firefox 并未居中表格

转载 作者:行者123 更新时间:2023-11-27 22:47:00 28 4
gpt4 key购买 nike

以下 HTML 无法在 FireFox 中创建居中表格,即使它可以在 Chrome 和 IE 中运行。我试过使用 margin: 0 auto 但这没有帮助。谁能帮帮我?

<html lang="en" class="no-js">
<head>
<meta charset="UTF-8">
<title>ICG Administrator Login</title>
<style type="text/css">
body {
margin-bottom: 0px;
margin-left: auto;
margin-right: auto;
margin-top: 0px;
}
h1 {
border-bottom-width: 0px;
border-left-width: 0px;
border-right-width: 0px;
border-top-width: 0px;
color: #00377E;
display: block;
font-family: sans-serif;
font-size: 26px;
font-style: normal;
font-variant: normal;
font-weight: bold;
height: 32px;
line-height: 32px;
margin-bottom: 0px;
margin-left: 0px;
margin-right: 0px;
margin-top: 0px;
padding-bottom: 0px;
padding-left: 0px;
padding-right: 0px;
padding-top: 0px;
text-align: center;
vertical-align: baseline;
}
table {
-webkit-border-horizontal-spacing: 0px;
-webkit-border-vertical-spacing: 0px;
border: 1px solid #053F89;
color: #444;
display: table-cell;
font-family: sans-serif;
font-size: 13px;
font-style: normal;
font-variant: normal;
font-weight: normal;
line-height: 16px;
margin-bottom: 0px;
margin-left: auto;
margin-right: auto;
margin-top: 0px;
padding-bottom: 0px;
padding-left: 0px;
padding-right: 0px;
padding-top: 0px;
position: static;
vertical-align: top;
white-space: normal;
}
</style>
</head>
<body>
<h1>Gateway and CDUE Administration</h1>
<div style="width: 100%; height: 50px; background-color: #053F89; background-origin: padding-box;"></div>
<DIV style="text-align: center;">
<form method="GET" action="j_security_check">
<BR>
<table>
<tr style="background-color: #053F89; font-weight: bold; color: white;">
<td colspan=2>Log In</td>
</tr>
<tr>
<td>User Name:</td>
<td><input type="text" name="j_username" />
</td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="j_password" />
</td>
</tr>
<tr>
<td colspan=2><input type="submit" value="Login" /></td>
</tr>
</table>
</form></DIV>
</body>
</html>

最佳答案

去掉第 42 行,display: table-cell;

关于html - 尽管使用边距 : 0 auto,但 Firefox 并未居中表格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6578249/

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