这是我在 WP 网站上输入的代码。文本居中但不在页面中间。它最终看起来像这样。我在编辑页面中放置的所有代码都列在图像链接下。 http://imageurlhost.com/images/or0d45cwh2ptrw1ov7c3_see-how-it-is-not-centered.png
<p style="text-align:center;">Partners began investing together in 2003 and formally formed RSR Finance in 2005
Investments in early to mid-stage companies
Investments across multiple industries
Particular focus areas include technology, equipment leasing, and manufacturing
Willingness and ability to invest through flexible and creative financing structures
Investments tailored to meet unique individual company situations</p>
<style>
body {
background: url("http://104.236.190.78/wp-content/uploads/2015/04/index-main-slider-2.jpg") repeat;
}
</style>
最佳答案
您需要为 body 标签指定一个宽度。查看 JSFiddle here
HTML:
<p>Partners began investing together in 2003 and formally formed RSR Finance in 2005
Investments in early to mid-stage companies
Investments across multiple industries
Particular focus areas include technology, equipment leasing, and manufacturing
Willingness and ability to invest through flexible and creative financing structures
Investments tailored to meet unique individual company situations</p>
CSS:
body {
width:100%;
background: url("http://104.236.190.78/wp-content/uploads/2015/04/index-main-slider-2.jpg") repeat;
}
p {width:100%; text-align:center;}
关于HTML:文本对齐问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30035014/