Wordpress主题的中心页脚

时间:2019-09-08 17:03:06

标签: html css wordpress wordpress-theming footer

我目前正在创建一个网站,并使用非常漂亮的雷克雅未克主题。首先,我创建了一个儿童主题。现在,我想对儿童主题进行一些修改。 在此模板中,可以对页脚进行个性化设置,但不能更改其位置。我提供与页面检查器一起检查它的位置,但是什么也没找到...

site-info

我提供了修改我的style.css子主题的功能,为页脚添加了相对位置,但它没有任何改变。.

Css modification

您对如何使页脚文本居中有任何想法吗?

非常感谢:)

杰里

2 个答案:

答案 0 :(得分:1)

我们在site-info类中添加边距:自动,然后文本居中。

.site-info { margin: auto }

Reykjavik

答案 1 :(得分:0)

如果您将块元素居中

这是如果您尝试居中<div><img>等居中的情况。
W3Schools list of inline and block elements

您可能要考虑使用margin: 0 auto;

.centered {
  margin: 0 auto;
  /*margin:0 auto: this gives the element a 0 top and bottom margin, and automatically sets the left and right to the maximum it can be*/
  width:100px;
  /*You need to specify a width for this to work*/
}
<div>
  <p class="centered">
    Hello World
  </p>
</div>

如果您将Inline元素居中

对于内联元素,例如<span><img>或文本元素
W3Schools list of inline and block elements

为此,您只需使用text-align:center;

.centered {
  text-align: center;
  /*Just tell the text to center itself in the element*/
}
<p class="centered">
  Hello World!
</p>

来源

W3Schools list of inline and block elements
CSS Tricks: Centering in CSS