HTML:文本对齐问题

标签 html css wordpress 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>

最佳答案

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

相关文章:

html - Kendo UI - 演示服务的源代码

javascript - 如何使用 Express 函数从 javascript 页面调用 PHP 页面

html - 为什么 <select >'s value attribute doesn' t 设置 <select> 的值属性?

html - box-sizing + 子对象

html - 在 HTML 元素的导航栏中编码 Logo 时出现问题

html - 是否可以在已经旋转的 X 中旋转 X

wordpress - 为什么 PHPUnit 不能对我的 Wordpress 网站进行单元测试

html - 如何在输入中添加 SVG 图标?

css - 没有 HTML 的图像淡入淡出 - 仅 CSS

wordpress - 从 SSL 上的裸域重定向失败