标记链接到外语? [英] Markup for link to foreign languages ?

查看:85
本文介绍了标记链接到外语?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设一个英语语言页面,链接到外国历史资源

'只能用外语提供。关于

的任何建议适当的最佳做法标记,特别是关于适用于< a>的lang属性的范围

。元素?


< p> Francisco de Miranda'< a

href =" http://www.simon-bolivar.org /bolivar/miranda_oci.html"

title =" Francisco de Miranda的传记(西班牙语)"

lang =" es" >传记< / a>< / p>

-

Smert''spamionam

解决方案




Andy Dingley写道:

假设一个英文页面,链接到外国历史资源<这只是用外语提供的。关于
适当的最佳实践的任何建议标记,特别是关于应用于< a>的lang属性的范围。元素?

< p> Francisco de Miranda'< a
href =" http://www.simon-bolivar.org/bolivar/miranda_oci.html"
title =" Francisco de Miranda的传记(西班牙语)"
lang =" es" >传记< / a>< / p>




hreflang怎么样?

< a hrefleng =" es"


http://www.w3.org/TR/html4/struct/li...#adef-hreflang

似乎是正确的属性。


-


Martin Honnen
http://JavaScript.FAQTs.com/


2004年11月23日星期二,Andy Dingley写道:
< blockquote class =post_quotes>< p> Francisco de Miranda'< a
href =" http://www.simon-bolivar.org/bolivar/miranda_oci.html"
title =" Francisco de Miranda的传记(西班牙语)"
lang =" es" >传记< / a>< / p>




< a href = ... lang =" es" title = Francisco de Miranda的传记">

Francisco de Miranda,biograf& iacute; a< / a>


-

热门发布。

Usenet上最令人恼火的事情是什么?


Andy Dingley写道:< blockquote class =post_quotes>假设一个英语语言页面,链接到一个外国历史资源
只能用外语提供。关于
适当的最佳实践的任何建议标记,特别是关于应用于< a>的lang属性的范围。元素?

< p> Francisco de Miranda'< a
href =" http://www.simon-bolivar.org/bolivar/miranda_oci.html"
title =" Francisco de Miranda的传记(西班牙语)"
lang =" es" >传记< / a>< / p>




来自HTML规范:


hreflang = langcode [CI ]

此属性指定由href指定的资源的基本语言

,并且只能在指定href时使用。


换句话说,lang用于表示元素的内容语言,而hreflang用于表示链接的

资源的语言。所以在你的例子中,你应该使用:


.... lang =" en" hreflang =" es" ... - 如果

基本语言已经是英语,则lang是多余的。


在LINK元素中,lan​​g是用于表示标题的语言

attribuet和hreflang,如上所示,表示链接的

资源的语言。


-

Chris Simon
os******@slcszetnet.co .uk
http://www.users .zetnet.co.uk / csimon /


Assume an English language page, linking to a foreign history resource
that''s only available in a foreign language. Any suggestions on
appropriate "best practice" markup, particularly regarding the scope
of a lang attribute applied to a <a> element ?

<p>Francisco de Miranda''s <a
href="http://www.simon-bolivar.org/bolivar/miranda_oci.html"
title="Biography of Francisco de Miranda (in Spanish)"
lang="es" >biography</a></p>

--
Smert'' spamionam

解决方案



Andy Dingley wrote:

Assume an English language page, linking to a foreign history resource
that''s only available in a foreign language. Any suggestions on
appropriate "best practice" markup, particularly regarding the scope
of a lang attribute applied to a <a> element ?

<p>Francisco de Miranda''s <a
href="http://www.simon-bolivar.org/bolivar/miranda_oci.html"
title="Biography of Francisco de Miranda (in Spanish)"
lang="es" >biography</a></p>



What about hreflang e.g.
<a hrefleng="es"
see
http://www.w3.org/TR/html4/struct/li...#adef-hreflang
that seems to be the proper attribute.

--

Martin Honnen
http://JavaScript.FAQTs.com/


On Tue, 23 Nov 2004, Andy Dingley wrote:

<p>Francisco de Miranda''s <a
href="http://www.simon-bolivar.org/bolivar/miranda_oci.html"
title="Biography of Francisco de Miranda (in Spanish)"
lang="es" >biography</a></p>



<a href=... lang="es" title=Biography of Francisco de Miranda">
Francisco de Miranda, biograf&iacute;a</a>

--
Top-posting.
What''s the most irritating thing on Usenet?


Andy Dingley wrote:

Assume an English language page, linking to a foreign history resource
that''s only available in a foreign language. Any suggestions on
appropriate "best practice" markup, particularly regarding the scope
of a lang attribute applied to a <a> element ?

<p>Francisco de Miranda''s <a
href="http://www.simon-bolivar.org/bolivar/miranda_oci.html"
title="Biography of Francisco de Miranda (in Spanish)"
lang="es" >biography</a></p>



From the HTML spec:

hreflang = langcode [CI]
This attribute specifies the base language of the resource
designated by href and may only be used when href is specified.

In other words, lang is used to denote the language of the content of
the element, and hreflang is used to denote the language of the linked
resource. so in your example, you should use:

....lang="en" hreflang="es"... - the lang being superfluous really if
the base language is already English.

In the LINK element, lang is used to denote the language of the title
attribuet and hreflang, as above, denotes the language of the linked
resource.

--
Chris Simon
os******@slcszetnet.co.uk
http://www.users.zetnet.co.uk/csimon/

** Get rid of all SLCs to reply directly **


这篇关于标记链接到外语?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆