我有这个调用模板的 php 页面:
if(!isset($_GET['step']) || $_GET['step'] == "" || $_GET['step'] == 1)
{
include("templates/install_db.html");
}
elseif(isset($_GET['step']) && $_GET['step'] == 2)
{
include("templates/install_settings.html");
}
install_db.html 模板:
<head>
<link href="templates/css/style.css" rel="stylesheet" type="text/css" />
</head>
<body style="background-color:cadetblue">
<div class="title"><h1>...</h1></div>
<div class="main">
<form action="?step=2" method="post">
<ul>
<li>
Database Host:
</li>
<li>
<input type="text" name="host" value="localhost" />
</li>
</ul>
<ul>
<li>
Database Username:
</li>
<li>
<input type="text" name="uname" />
</li>
</ul>
</form>
</div>
...
而这个 CSS 样式:
root {
display: block;
}
ul {
display: table-row;
text-align: center;
}
ul li {
text-align: center;
display: table-cell;
}
.main {
text-align: center;
font-family: 'Lucida Console';
}
.title {
text-align: center;
font-family: 'Lucida Console';
}
而且我想将 ul/li 列表居中...如果我删除 table-row / table-cell 显示属性,则列表居中,否则它会留在左侧。在我看来,列表应该居中。我做错了什么?
更新:我使用最后一个谷歌浏览器版本作为浏览器