gpt4 book ai didi

html - CSS 断字语言

转载 作者:太空狗 更新时间:2023-10-29 13:46:47 25 4
gpt4 key购买 nike

是否可以定义用于 -webkit-hyphens:auto 的语言?是否默认为系统语言?

<p style="-webkit-hyphens:auto" lang="en">
Hyphenated in English
</p>
<p style="-webkit-hyphens:auto" lang="es">
Hyphenated en Español
</p>

根据Mozilla documentation hyphens 属性将使用 lang HTML 属性中指定的语言。但是,我在 Safari documentation 中找不到任何关于 -webkit-hyphens 属性的提及。 .

此外,meta language 属性有什么作用吗?或者这可以应用于 html 元素吗?

这是 fiddle我用于测试(在 Safari 和 Firefox 中)。

最佳答案

Is it possible to define the language used for -webkit-hyphens:auto?

是的。

However, I can't find any mention of the -webkit-hyphens property in the Safari documentation.

根据 webkit 变更日志,它确实允许指定语言。

https://bugs.webkit.org/show_bug.cgi?id=43467

您可能需要使用 -webkit-hyphenate-locale 才能使其正常工作。

Or can this be applied applied to the html element?

根据这篇文章及其示例,您可以在元素中设置 lang 属性。

http://drublic.de/blog/css3-auto-hyphenation-for-text-elements/

关于html - CSS 断字语言,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7907097/

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