简体   繁体   English

CSS连字语言

[英]CSS hyphenation language

Is it possible to define the language used for -webkit-hyphens:auto ? 是否可以定义用于-webkit-hyphens:auto的语言-webkit-hyphens:auto Does it default to the system language? 它是否默认使用系统语言?

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

According to the Mozilla documentation the hyphens property will use the language specified in the lang HTML attribute. 根据Mozilla文档hyphens属性将使用lang HTML属性中指定的lang However, I can't find any mention of the -webkit-hyphens property in the Safari documentation . 但是,我在Safari文档中找不到任何关于-webkit-hyphens属性的提及。

Additionally, does the meta language attribute have any effect? 另外,元language属性是否有任何影响? Or can this be applied applied to the html element? 或者这可以应用于html元素吗?

Here's the fiddle I'm using for testing (in Safari and Firefox). 这是我用于测试的小提琴 (在Safari和Firefox中)。

Is it possible to define the language used for -webkit-hyphens:auto ? 是否可以定义用于-webkit-hyphens:auto的语言-webkit-hyphens:auto

Yes. 是。

However, I can't find any mention of the -webkit-hyphens property in the Safari documentation. 但是,我在Safari文档中找不到任何关于-webkit-hyphens属性的提及。

According to the webkit changelog, it does allow the language to be specified. 根据webkit changelog,它确实允许指定语言。

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

You may need to use -webkit-hyphenate-locale to get it to work. 您可能需要使用-webkit-hyphenate-locale才能使其正常工作。

Or can this be applied applied to the html element? 或者这可以应用于html元素吗?

According to this post and its examples, you can set the lang attribute right in the element. 根据这篇文章及其示例,您可以在元素中设置lang属性。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM