html - 删除 html/css 中单词之间的额外空格

标签 html css

我正在使用 html/css 和 text-align: justify;当我使用第二行下面的文字时,单词之间有很大的差距。其余的东西都很好。

<p style="text-align: justify;">Lorem Ipsum is simply dummy text of the <a href="http://example.com"> example </a>and Lorem Ipsum is simply dummy text of the lorem. I'm also printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic </p>

我在第 2 行的每个单词之间得到了很多额外的空格。我该如何解决? 像这样:

    Lorem Ipsum is simply dummy text of the Lorem Lorem Lorem Lorem Lorem 
    text   of    the   lorem.   I'm   also   printing   and    typesetting     industry.   
    Lorem Ipsum has been

最佳答案

text-align: justify; 展开一行以确保行尾没有空隙。为此,它必须在中间添加额外的空格。

如果您不想这样做,请不要执行 text-align: justify;,或者告诉我们您希望它做什么?也许你想要 text-align: left

:)

关于html - 删除 html/css 中单词之间的额外空格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46718427/

相关文章:

html - 在事件时更改 wordpress 导航项菜单背景颜色

javascript - 尝试修复时菜单项显示不正确和对齐方式发生变化的问题

javascript - 从 <a> 标记的下拉列表中自动选择值

html - 如何制作一个div(宽度: auto) adjust to nested divs (float left and fixed width)

css - 在 CSS 中选择动态元素名称

jquery - 使用 jQuery 扩展位于页面右边缘的单个 <li> 元素?

html - 主页宽度 100% 宽度和其他(输入表单)窄宽度的 Rails 布局

html - 强调通过 CSS/JS 逐渐消失?

javascript - 单击父类的另一个子级时,如何获得子级的值?

html - 修复 Edge 中背景图像的边界半径模糊?