如何在我的网站上启用 iOS 5 Safari 阅读器? [英] How to enable iOS 5 Safari Reader on my website?
问题描述
iOS 5 中 Mobile Safari 的阅读器功能如何工作?如何在我的网站上启用它.我如何告诉它我页面上的哪些内容是触发该功能的文章?
How does the Reader function of Mobile Safari in iOS 5 work? How do I enable it on my site. How do I tell it what content on my page is an article to trigger this function?
推荐答案
这里发布的很多答案都包含虚假信息.以下是一些更正/澄清:
A lot of the answers posted here contain false information. Here are some corrections/clarifications:
<article>
元素可以很好地用作包装器;Safari 阅读器可以识别它.我的网站就是一个例子.你选择哪个包装元素并不重要,只要有一个,除了<body>
或<p>
.你可以使用<article>
、<div>
、<section>
;或为此目的在语义上不正确的元素,例如<nav>
、<aside>
、<footer>
、<标题>
;甚至像<span>
(!) 这样的内联元素.
The
<article>
element works fine as a wrapper; Safari Reader recognizes it. My site is an example. It doesn’t matter which wrapper element you choose, as long as there is one, other than<body>
or<p>
. You can use<article>
,<div>
,<section>
; or elements that are semantically incorrect for this purpose, like<nav>
,<aside>
,<footer>
,<header>
; or even inline elements like<span>
(!).
Reader 工作不需要标题.这是一个没有任何 <h*>
元素的文档示例,Reader 可以正常工作:http://mathiasbynens.be/demo/safari-reader-test-3
No headings are required for Reader to work. Here’s an example of a document without any <h*>
elements on which Reader works fine: http://mathiasbynens.be/demo/safari-reader-test-3
我在此处发布了有关我的发现的更多详细信息:http://mathiasbynens.be/notes/safari-阅读器
I posted some more details regarding my findings here: http://mathiasbynens.be/notes/safari-reader
这篇关于如何在我的网站上启用 iOS 5 Safari 阅读器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!