HTML:文本对齐问题

时间:2015-05-04 16:26:14

标签: html css wordpress wordpress-plugin wordpress-theming

这是我在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>

1 个答案:

答案 0 :(得分:0)

您需要为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;}