【发布时间】:2019-07-19 01:51:15
【问题描述】:
我已经很接近了,但我想再做一步,尝试用点填充文本中的所有空白,直到行尾。全部不用js。
我为单行元素找到了不同的解决方案,就像我在文档中的大多数解决方案一样,但对于多行元素没有任何解决方案。
我更接近的是使用:after 选择器添加一些点作为内容并在文本上设置overflow: hidden,这导致我的较长行消失了。
我正在使用 table atm 来解决这个问题:
.container {
width: 600px;
text-align: justify;
font-family: 'Arial Narrow', arial, sans-serif;
}
table {
width: 100%;
}
.incipit {
width: 10%;
}
.text {
width: 90%;
}
.page {
width: 15px;
}
.level-0>.text {
width: 100%;
}
.level-0 {
font-weight: bold;
}
.level-1 {
font-weight: bold;
}
<div class="container">
<h2>
Table of Contents
</h2>
<table>
<tr class='level-0'>
<td class="text" colspan="2">First level index element</td>
<td class="page" align="right" valign="bottom">1</td>
</tr>
<tr class="level-1">
<td class="incipit" valign="top">Art. 1</td>
<td class="text">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam vel elementum erat. In non magna tellus. Donec id tellus ut leo consequat elementum. Praesent eu ligula in neque ultricies mollis sit amet sed risus.</td>
<td class="page" align="right" valign="bottom">1</td>
</tr>
</table>
</div>
这是一个fiddle,里面有我现在拥有的代码。
你们有没有遇到过同样的问题?任何建议表示赞赏
【问题讨论】: