Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/list/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 居中显示:表格行UL/LI列表_Css_List_Center_Css Tables_Tablerow - Fatal编程技术网

Css 居中显示:表格行UL/LI列表

Css 居中显示:表格行UL/LI列表,css,list,center,css-tables,tablerow,Css,List,Center,Css Tables,Tablerow,我有一个调用模板的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"); } <h

我有一个调用模板的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");
}
<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>
...
install_db.html模板:

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");
}
<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>
...
我想把ul/li列表放在中间。。。如果删除表格行/表格单元格,则列表将以其他方式居中,并保持在左侧。在我看来,名单应该居中。我做错了什么


更新:我使用上一个google chrome版本作为浏览器

我已经找到了解决方案。。。text align属性不适用于表行、表单元格等显示类型,因此我在表单中添加了另一个
,并将该div的显示设置为
内联块
,这就解决了。

我找到了解决方案。。。text align属性不适用于表行、表单元格等显示类型,因此我在表单中添加了另一个
,并将该div的显示设置为
内联块
,这就解决了