【发布时间】:2015-09-26 00:17:55
【问题描述】:
我一直在尝试将包含 ul 分页的内容居中。 margin-left 和 margin0right 只使 div 居中,但 text-align: center 不会使里面的内容居中。
代码如下:
CSS
/* Pagenation */
.article .pagelinks { text-align: center !important; display: table; margin-left: auto; margin-right: auto; width: 240px; position: relative; overflow: hidden; padding: 0; clear: both; }
.article .pagelinks ul { list-style:none; text-align: center; margin: auto; padding: 0; }
.article .page-numbers li {display:inline;}
.article .page-numbers li a {display:block; float:left; padding:4px 9px; margin-right:7px; color: #911d23;}
.article .page-numbers li span.current {display:block; float:left; padding:4px 9px; margin-right:7px; background-color: #fff; color: #911d23;}
这里是相关网页的链接:http://disa.com.sv/constructora/?page_id=10&paged=2。
如何让它以文本居中或居中对齐?
【问题讨论】:
-
请在问题本身中包含所有相关代码。如果问题在链接中得到解决(或者它死了),这个问题对于遇到类似问题的其他用户将毫无用处。
标签: css wordpress pagination