简体   繁体   English

打印视图链接iaw HTML5的正确rel属性值

[英]Proper rel attribute value for print view link iaw HTML5

I started to design my site consistent with HTML5 (semi) standards. 我开始设计符合HTML5(半)标准的网站。

I have a link as: 我有一个链接为:

<a href="#" title="Print View" rel="">Print View</a>

My site is PHP driven and this link opens a page which I can not create it with pure css. 我的网站是PHP驱动的,此链接打开一个页面,我无法使用纯CSS创建它。 (additional content exists on print view page). (其他内容存在于打印视图页面上)。 So I must have this link. 所以我必须有这个链接。

I ask for the Proper rel attribute value for print view link 我要求打印视图链接的适当的rel属性值

I googled my question but couldn't find any help also I looked to HTML5 Doctor, W3C 我用Google搜索了我的问题,但也没有找到任何帮助,因此我查看了HTML5 Doctor,W3C

regards 问候

This partly depends on what the link really points to, but it seems that it is a version of the current page with some additional information and/or styling for the print media. 这部分取决于链接实际指向的内容,但似乎它是当前页面的版本,带有一些有关打印介质的其他信息和/或样式。 In that case, the attribute 在这种情况下,该属性

rel="alternate"

would seem to be adequate. 似乎足够了。 The definition of rel="alternate" is not exact, so it is debatable how much the two documents may differ, when it says “The keyword creates a hyperlink referencing an alternate representation of the current document.” rel="alternate"的定义不正确,因此当它说“关键字创建引用当前文档的替代表示形式的超链接”时,两个文档可能有多少差异尚有争议。

In practice, the attribute rel="alternate" is mostly ignored. 实际上,大多数情况下会忽略属性rel="alternate" It may, or might, be used by search engines to decide that the linked document need not be visited, as its content is basically the same as that of the current document. 搜索引擎可能会或可能会使用它来确定不需要访问链接的文档,因为其内容与当前文档的内容基本相同。 If that's OK, you can use it. 如果可以,您可以使用它。

By the way, a link text like “Printable version” might be more descriptive. 顺便说一句,诸如“可打印版本”之类的链接文字可能更具描述性。 “Print View” sounds like Print Preview, something that you can do with the tools of the browser “打印视图”听起来像“打印预览”,您可以使用浏览器的工具进行操作

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

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