我正在尝试将其居中:
[![在此处输入图片描述][1]][1]
这是 HTML:
<section class="page-section parallax directions" id="location" style="padding-top:10%">
<div class="container div-table">
<div class="parallax-bg" data-stellar-background-ratio="0.5" data-stellar-vertical-offset="-150"></div>
<div class="parallax-overlay"></div>
<div class="parallax-inner text-center">
<?php
session_start();
if(isset($_SESSION['playername']))
{
?>
<div class="panel panel-warning" style="padding-left:10px;padding-right:10px">
<h3 class='panel-header panel shadow text-center'><?php echo $_SESSION['playername'] ?> UCP</h3>
<div class="panel panel-body">
<table>
<tr>
<td class="text-center">
<h4><a href="signature.php?user=<?php echo $_SESSION['playername'] ?>">My Signature</a></h4>
</td>
</tr>
<tr>
<td class="text-center">
<h4><a href="profile.php?user=<?php echo $_SESSION['playername'] ?>">My Profile</a></h4>
</td>
</tr>
<tr>
<td class="text-center">
<h4><a href="account/change.php">Change My Password</a></h4>
</td>
</tr>
<tr>
<td class="text-center">
<h4><a href="logout.php">Logout</a></h4>
</td>
</tr>
</table>
</div>
</div>
<?php
}
else
{
header("location:index.php");
}
?>
</div>
</section>
如果是这样的话,我正在使用 bootstrap 顺便说一句。
编辑:我已经完全编辑了上面的代码,但我没有完全展示。
最佳答案
试试 padding-left:auto;和 padding-right:auto;相反,10px 并不多
问候
雷切尔
关于html - 无法将内容移至中心,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32488594/