html - 对齐 block 的字间距

标签 html css styles justify

我想要一些 text-align:justify block ,但它们之间的字间距相同。

有人对此有解决方案吗?

我尝试使用负字间距,但这不是解决方案。

text-align:justify;
word-spacing:-1px;

谢谢!

最佳答案

嗯,当文本设置为justify 时,您不能设置负值。您必须设置一个更高的值,例如 10px

在这 3 种解决方案之间进行选择:

.justify {
  text-align: justify;  
}

.word-spacing {
  word-spacing: 10px;
}

.both {
  text-align: justify;
  word-spacing: 10px;
}
<p class="justify"><b>Justify</b><br>
  Continually architect user-centric products for interactive experiences. Authoritatively supply goal-oriented meta-services without one-to-one synergy. Monotonectally formulate bleeding-edge ROI before fully tested networks. Authoritatively fabricate leading-edge infrastructures for enabled solutions. Competently communicate open-source total linkage before.
</p>

<p class="word-spacing"><b>Word Spacing Only</b><br>
  Continually architect user-centric products for interactive experiences. Authoritatively supply goal-oriented meta-services without one-to-one synergy. Monotonectally formulate bleeding-edge ROI before fully tested networks. Authoritatively fabricate leading-edge infrastructures for enabled solutions. Competently communicate open-source total linkage before.
</p>

<p class="both"><b>Justfy + Word Spacing</b><br>
  Continually architect user-centric products for interactive experiences. Authoritatively supply goal-oriented meta-services without one-to-one synergy. Monotonectally formulate bleeding-edge ROI before fully tested networks. Authoritatively fabricate leading-edge infrastructures for enabled solutions. Competently communicate open-source total linkage before.
</p>

关于html - 对齐 block 的字间距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38432625/

相关文章:

html - 有谁知道如何使用 css3 在标题上创建双曲线?

css - 如何在 PHP 中为奇数行和偶数行添加背景颜色?

java - 如何解决这个错误?我无法运行它,所以我不知道?

html - 为什么 flex 元素不缩小过去的内容大小?

html - 在适当级别的两列中的文本

javascript - 显示导航菜单水平镶边问题

javascript - AngularJS 触发功能单击 anchor 链接

javascript - 页面重新加载后保留文本框上的值

javascript - 在鼠标悬停时设置背景图像

javascript - 将下拉列表 ul 列表在下拉导航顶部的相同高度对齐