如何在div标签中调整文本的对齐方式

时间:2014-03-31 12:01:17

标签: html css

<div style="text-align:justify; text-justify:newspaper;width:300px;height:200px;border:1px solid">
<p>
We are a mix of young, energetic individuals mentored by experienced seniors who as a team are passionate about continually moving out of our comfort <br> zones.
some text

</div>

我在网页上添加了大量文字。我无法将文本调整为合理的。 从左侧可以,但在右侧不行......请告诉我更改。 我想以报纸格式添加文字..

1 个答案:

答案 0 :(得分:0)

试试这个:http://jsfiddle.net/945cn/1/

您有一个随机的,不需要的<p>标记而没有结束</p>标记,因此我删除了它。另外,我建议不要使用内联css并将css放在我在JSFiddle中显示的样式表中。如果这对您有用,请告诉我。

<强> HTML:

<div class="justified">
    We are a mix of young, energetic individuals mentored by experienced seniors who as a team are passionate about continually moving out of our comfort
    <br>zones. some text
</div>

<强> CSS:

.justified {
    text-align:justify;
    width:300px;
    height:200px;
    border:1px solid
}