CSS居中列表项目符号和编号

时间:2016-06-28 16:46:14

标签: html css

我对我正在制作的网站有疑问。框内有2个列表,所有文本似乎都以文本最左侧的子弹为中心。我在我当地的主机上检查了这个,没有发现任何问题。但是,当我将其上传到我的网络服务器时,问题就出现了。我希望文本居中,但子弹更靠近文本。附件是框的CSS和HTML。还有一个指向问题link的文件的链接(它已在线但未公开链接)



Private Sub Worksheet_Change(ByVal Target As Range)

  If Target.Column = 22 and Target = "Yes" Then

      Application.EnableEvents = False

      Dim wb as Workbook
      Set wb = Workbooks.Open(ThisWorkbook.Path & "\FPPE Archive.xlsm"

      Dim ws as Worksheet
      Set ws = wb.Worksheets("EUHM Onboard")

      nxtRow = ws.Range("V" & Rows.Count).End(xlUp).Row + 1

      Target.EntireRow.Copy Destination:=ws.Range("A" & nxtRow)

      Target.EntireRow.Delete

      wb.Close True

      Application.EnableEvents = True      

  End If

End Sub

.centerDivR {
  width: 80%;
  height: 500px;
  margin: 0 auto;
}
.rulesspace {
  width: 4%;
  height: 300px;
  float: left;
}
.news2 {
  width: 46%;
  height: 300px;
  background-color: rgba(192, 192, 192, 0.6);
  float: left;
  padding: 4px;
}
.rulesa {
  width: 46%;
  height: auto;
  float: left;
  padding: 4px;
}
.rulesb {
  width: 46%;
  height: auto;
  float: left;
  padding: 4px;
}




1 个答案:

答案 0 :(得分:2)

您可能有一些不匹配的<div>元素或其他标记错误,请{3}}您的HTML并修复它们。

如果您确实将列表项设置为居中对齐(或从容器继承)。试试这个:

li {
  list-style-position: inside;
}

<强> valid

&#13;
&#13;
body {
  text-align: center;
}
li {
  list-style-position: inside;
}
&#13;
<ul>
  <li>No Advertiseing other servers</li>
  <li>Four Strike Policy
    <ol>
      <li>1st Warning</li>
      <li>2nd Warning</li>
      <li>2 Week Ban</li>
      <li>Perminate Suspension</li>
    </ol>
  </li>
  <li>Please keep foul language to a minimum</li>
  <li>Be considerate of other players</li>
  <li>Discussion or distribution of pirated or illegally acquired software is strictly prohibited</li>
</ul>
&#13;
&#13;
&#13;