gpt4 book ai didi

html - 为什么 "text-align-last"在 Safari 上不起作用并且行为异常?

转载 作者:太空宇宙 更新时间:2023-11-03 20:25:14 24 4
gpt4 key购买 nike

这是我在 StackOverflow 上的第一个问题。直到今天,我总是能在这个网站上找到解决问题的办法,但这次我不得不打电话求助。

我需要显示来自数据库的文本。此文本包含换行符(不是 <br> ,只是一个空白返回 - 这就是它在数据库中的保存方式)。这段文字是有道理的。我在 Chrome 或 Firefox 上没有问题,但在 Safari 上,每个段落的最后一行(或准确地说是文本 block )也是合理的,在单词之间创建了很大的空间。奇怪的是,当我用光标突出显示文本时,每个段落的最后一行都在左边。

我申请了 text-align-last: left;但它不会改变 Safari 上的任何东西。我也试过-webkit-text-align-last: left;但我没有成功。文本在 <p> 中, 我试着把它变成 <div>相反,但没有变化。

.quoteText {
font-family: Georgia;
font-style: italic;
font-size: 18px;
margin-top: 20px;
margin-left: 3%;
margin-right: 3%;
}
.justified {
white-space: pre-line;
text-align: justify;
text-align-last: left;
}
<p class="quoteText justified">
How often since then has she wondered what might have happened if she&#039;d tried to remain with him; if she’d returned Richard&#039;s kiss on the corner of Bleeker and McDougal, gone off somewhere (where?) with him, never bought the packet of incense or the alpaca coat with rose-shaped buttons. Couldn’t they have discovered something larger and stranger than what they&#039;ve got. It is impossible not to imagine that other future, that rejected future, as taking place in Italy or France, among big sunny rooms and gardens; as being full of infidelities and great battles; as a vast and enduring romance laid over friendship so searing and profound it would accompany them to the grave and possibly even beyond. She could, she thinks, have entered another world. She could have had a life as potent and dangerous as literature itself.

Or then again maybe not, Clarissa tells herself. That&#039;s who I was. This is who I am--a decent woman with a good apartment, with a stable and affectionate marriage, giving a party. Venture too far for love, she tells herself, and you renounce citizenship in the country you&#039;ve made for yourself. You end up just sailing from port to port.

Still, there is this sense of missed opportunity. Maybe there is nothing, ever, that can equal the recollection of having been young together. Maybe it&#039;s as simple as that. Richard was the person Clarissa loved at her most optimistic moment. Richard had stood beside her at the pond&#039;s edge at dusk, wearing cut-off jeans and rubber sandals. Richard had called her Mrs. Dalloway, and they had kissed. His mouth had opened to hers; (exciting and utterly familiar, she&#039;d never forget it) had worked its way shyly inside until she met its own. They&#039;d kissed and walked around the pond together.

It had seemed like the beginning of happiness, and Clarissa is still sometimes shocked, more than thirty years later to realize that it was happiness; that the entire experience lay in a kiss and a walk. The anticipation of dinner and a book. The dinner is by now forgotten; Lessing has been long overshadowed by other writers. What lives undimmed in Clarissa&#039;s mind more than three decades later is a kiss at dusk on a patch of dead grass, and a walk around a pond as mosquitoes droned in the darkening air. There is still that singular perfection, and it&#039;s perfect in part because it seemed, at the time, so clearly to promise more. Now she knows: That was the moment, right then. There has been no other.
</p>

我希望整个文本对齐,并且每个文本 block 的最后一行左对齐。同样,它适用于 Chrome 和 Firefox,但不适用于 Safari。

Screenshot of how the text is displayed (see the last lines of each block) and how the last line reacts when it is selected

最佳答案

实际上,Safari 不支持它。请检查以供引用: https://developer.mozilla.org/en-US/docs/Web/CSS/text-align-last

关于html - 为什么 "text-align-last"在 Safari 上不起作用并且行为异常?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56988344/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com