`
leonzhx
  • 浏览: 793861 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

What Does It All Mean?

 
阅读更多

1.  In Activating Browser Modes with Doctype , Henri Sivonen summarizes the different modes browser will work in based on the doctype:

  Quirks Mode

In the Quirks mode, browsers violate contemporary Web format specifications in order to avoid “breaking” pages authored according to practices that were prevalent in the late 1990s.

  Standards Mode

In the Standards mode, browsers try to give conforming documents the specification-wise correct treatment to the extent implemented in a particular browser. HTML5 calls this mode the “no quirks mode.”

  Almost Standards Mode

Firefox, Safari, Chrome, Opera (since 7.5) and IE8 also have a mode known as “Almost Standards mode,” that implements the vertical sizing of table cells traditionally and not rigorously according to the CSS2 specification. HTML5 calls this mode the “limited quirks mode.”

 

2.  This is the HTML5 doctype:

<!DOCTYPE html>
 

which is shorter and sweeter and also triggers “standards mode” in all modern browsers.

 

 

3.  Elements in HTML5 are always in the XHTML namespace. You no longer need to declare xmlns=“http://www.w3.org/1999/xhtml” in <html> tag. lang and xml:lang attributes in <html> tag both define the language of this HTML page. This is a vestige of XHTML. Only the lang attribute has any effect in HTML5. You can keep the xml:lang attribute if you like, but if you do, you need to ensure that it contains the same value as the lang attribute.

 

4.  A n HTTP header like this:

Content-Type: text/html; charset="utf-8"

 says that the web server thinks it’s sending you an HTML document and the document uses the UTF-8 character encoding. However, few authors actually have control over their HTTP server. So HTML 4 provided a way to specify the character encoding in the HTML document itself:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

 Both of these techniques still work in HTML5. The HTTP header is the preferred method, and it overrides the <meta> tag if present. And it got a little easier in HTML5:

<meta charset="utf-8" /> 

 Which itself should be encoded in ASCII( http://www.w3.org/TR/html4/charset.html#h-5.2.2 )

 

5.  Link relations are to explain why you’re pointing to another resource. They may tell browsers:

  a)   it’s a stylesheet containing CSS rules that your browser should apply to this document.

  b)   it’s a feed that contains the same content as this page, but in a standard subscribable format.

  c)   it’s a translation of this page into another language.

  d)   it’s the same content as this page, but in PDF format.

  e)   it’s the next chapter of an online book of which this page is also a part.

 

6.  HTML5 breaks link relations into two categories : Links to external resources are links to resources that are to be used to augment the current document, and hyperlink links are links to other documents. The exact behavior for links to external resources depends on the exact relationship, as defined for the relevant link type.

 

7.   Most often, link relations are seen on <link> elements within the <head> of a page. Some link relations can also be used on <a> elements , See the full chart of link relations to check where you can use specific rel values.

 

8.  One small optimization you can make in HTML5 is to drop the type attribute from the CSS LINK element. There’s only one stylesheet language for the web, CSS, so that’s the default value for the type attribute.

9.  The rel="alternate" link relation has always been a strange hybrid of use cases, In HTML5, its definition has been clarified and extended to more accurately describe existing web content. Using rel="alternate" in conjunction with type=application/atom+xml indicates an Atom feed for the current page: 

 

<link rel="alternate"

       type="application/atom+xml"

       title="My Weblog feed"

       href="/feed/" />

 But you can also use rel="alternate" in conjunction with other type attributes to indicate the same content in another format, like PDF.

10.   The correct way to link to translations of documents is to use rel="alternate" in conjunction with the hreflang attribute to specify the language of the linked document.

11. rel="author" is used to link to information about the author of the page. This can be a mailto: address , though it doesn’t have to be. It could simply link to a contact form or “about the author” page. 

 

12. HTML 4 defined rel="start" , rel="prev" , and rel="next" to define relations between pages that are part of a series. HTML5 includes rel="next" and rel="prev" , just like HTML 4, and supports rel="previous" for backward compatibility.

 

13.   rel="icon" is usually found together with shortcut , like so:

<link rel="shortcut icon" href="/favicon.ico">

All major browsers support this usage to associate a small icon with the page. Usually it’s displayed in the browser’s location bar next to the URL, or in the browser tab, or both.

 

14.   rel="license" indicates that the referenced document provides the copyright license terms under which the current document is provided.

 

15.  rel="nofollow" indicates that the link is not endorsed by the original author or publisher of the page, or that the link to the referenced document was included primarily because of a commercial relationship between people affiliated with the two pages. The thinking was that if “nofollow” links did not pass on PageRank, spammers would give up trying to post spam comments on weblogs. That didn’t happen, but rel="nofollow" persists.

16. rel="noreferrer" indicates that no referrer information is to be leaked when following the link.

 

17.  rel="search" indicates that the referenced document provides an interface specifically for searching the document and its related resources.” If you want rel="search" to do anything useful, it should point to an OpenSearch
 document that describes how a browser could construct a URL to search the current site for a given keyword.

18. rel="tag" indicates that the tag that the referenced document represents applies to the current document.” Browsers do not do anything special with them; they’re really designed for search engines to use as a signal of what the page is about.

 

19. HTML5 also defines new semantic elements:

  a)   The <section> element represents a generic document or application section. A section, in this context, is a thematic grouping of content, typically with a heading. Examples of sections would be chapters, the tabbed pages in a tabbed dialog box, or the numbered sections of a thesis. A Web site's home page could be split into sections for an introduction, news items, contact information.

 

  b)   The <nav> element represents a section of a page that links to other pages or to parts within the page: a section with navigation links. Not all groups of links on a page need to be in a nav element — only sections that consist of major navigation blocks are appropriate for the nav element. In particular, it is common for footers to have a short list of links to common pages of a site, such as the terms of service, the home page, and a copyright page. The footer element alone is sufficient for such cases, without a nav element.

 

  c)   The <article> element represents a component of a page that consists of a self-contained composition in a document, page, application, or site and that is intended to be independently distributable or reusable. This could be a forum post, a magazine or newspaper article, a Web log entry, a user-submitted comment, an interactive widget or gadget, or any other independent item of content.

 

  d)   The <aside> element represents a section of a page that consists of content that is tangentially related to the content around the aside element, and which could be considered separate from that content. Such sections are often represented as sidebars in printed typography. The element can be used for typographical effects like pull quotes or sidebars, for advertising, for groups of nav elements, and for other content that is considered separate from the main content of the page.

 

  e)   The <hgroup> element represents the heading of a section. The element is used to group a set of h1 h6 elements when the heading has multiple levels, such as subheadings, alternative titles, or taglines.

 

  f)   The <header> element represents a group of introductory or navigational aids. A header element is intended to usually contain the section’s heading (an h1 h6 element or an hgroup element), but this is not required. The header element can also be used to wrap a section’s table of contents, a search form, or any relevant logos.

 

  g)   The <footer> element represents a footer for its nearest ancestor sectioning content or sectioning root element. A footer typically contains information about its section such as who wrote it, links to related documents, copyright data, and the like. Footers don’t necessarily have to appear at the end of a section, though they usually do. When the footer element contains entire sections, they represent appendices, indexes, long colophons, verbose license agreements, and other such content.

 

  h)  T he <time> element represents either a time on a 24 hour clock, or a precise date in the proleptic Gregorian calendar, optionally with a time and a time-zone offset.

 

  i)   The <mark> element represents a run of text in one document marked or highlighted for reference purposes.

 

20.   All browsers render unknown elements inline, as if they had a display:inline CSS rule. There are several new elements defined in HTML5 which are block-level elements. That is, they can contain other block-level elements. If you want to use these elements in older browsers, you will need to define the display style manually:

article,aside,details,figcaption,figure,

footer,header,hgroup,menu,nav,section {

    display:block;

}

 However, prior to version 9, Internet Explorer did not apply any styling on unknown elements.

 

 

21.   If IE 8 doesn’t explicitly recognize the element name, it will insert the element into the DOM as an empty node with no children . All the elements that you would expect to be direct children of the unknown element will actually be inserted as siblings instead. If you create a dummy  <article> element with JavaScript before you use it in your page, Internet Explorer will magically recognize the  <article> element and let you style it with CSS. There is no need to ever insert the dummy element into the DOM . Simply creating the element once (per page) is enough to teach IE to style the element it doesn’t recognize:

<!--[if lt IE 9]>

<script>

  var e = ("abbr,article,aside,audio,canvas,datalist,details," +

    "figure,footer,header,hgroup,mark,menu,meter,nav,output," +

    "progress,section,time,video").split(',');

  for (var i = 0; i < e.length; i++) {

    document.createElement(e[i]);

  }

</script>

<![endif]-->

 You can also reference a minified version:

<!--[if lt IE 9]>

<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js
"></script>

<![endif]-->

 

22.   In HTML 4,  <h1> <h6> elements were the only way to create a document outline. However it does not provide a way to mark up a subheading without adding it to the document outline. The  <hgroup> element acts as a wrapper for two or more related heading elements. Headings in one group only create a single node in the document outline. Thus you can group your heading and its subheading(marked up as a smaller heading) into one group.

 

23.   The HTML5 specification defines an algorithm for generating a document outline that incorporates the new semantic elements in HTML5 . The HTML5 algorithm says that an <article> or <nav> element creates a new section, that is, a new node in the document outline. And in HTML5 , each section can have its own <h1> element. And the <article> element can have its own <header> element. You can test your own pages in the HTML5 Outliner to ensure that you’re using the heading elements properly.

 

24.   There are three parts to a <time> element:

  a)   A machine-readable timestamp

  b)   Human-readable text content

  c)   An optional pubdate flag 

<time datetime="2009-10-22T13:59:47-04:00" pubdate>

  October 22, 2009 1:59pm EDT

</time> 

 The pubdate attribute is a Boolean attribute. It means one of two things. If the <time> element is in an <article> element, it means that this timestamp is the publication date of the article. If the  <time> element is not in an <article> element, it means that this timestamp is the publication date of the entire document. 

 

25.   People with disabilities care about the semantics of site navigation. Once they get past the page title, the next important pieces of information about a page are the major navigation links. If they want to navigate quickly, they’ll tell their screenreader to jump to the navigation bar and start reading. Thus being able to determine navigation links programmatically is important. HTML5 provides a semantic way to mark up navigation sections: the  <nav> element.

 

26.   The HTML5 specification says, “A footer typically contains information about its section such as who wrote it, links to related documents, copyright data, and the like.”

分享到:
评论

相关推荐

    托马斯·内格尔:What Does It All Mean——A Very Short Introduction to Phil

    《What Does It All Mean?——哲学的极简介绍》是托马斯·内格尔的一本面向初学者的哲学入门书籍。这本书旨在为那些对哲学毫无了解的读者提供一个简明的引导,它不仅适合大学生及以上年龄层的读者,也期望能吸引到对...

    教程第四册听力练习录音文本和答案

    本资源包括答案和录影原文,是不错的资源。Uint1 II. Basic Listening Practice 1. Script M: I’m beside myself with joy. I’m so lucky. Guess what? I’ve won a lit of money in ...Q: What does the woman mean?

    The Little Prover

    What does it mean for a statement to be true? Some statements can be verified directly. To determine whether a particular omelette is delicious, we merely have to taste the omelette. Our answer is ...

    Hands-On Machine Learning with Scikit-Learn and TensorFlow PDF

    What exactly does it mean for a machine to learn something? If I download a copy of Wikipedia, has my computer really “learned” something? Is it suddenly smarter? In this chapter we will start by ...

    Hands-On Machine Learning with Scikit-Learn and TensorFlow

    What exactly does it mean for a machine to learn something? If I download a copy of Wikipedia, has my computer really “learned” something? Is it suddenly smarter? In this chapter we will start by ...

    P.A.T.C.H. - Ultimate Patching System [FULL]

    What does it mean? It means that if you change only 5 bytes in your game, P.A.T.C.H. will create a patch that will change only those 5 bytes on users' builds, instead of downloading the entire edited ...

    四级冲刺讲义

    - **问题**: What does the woman mean? - **解析**: 本题考查的是主题思维。男士询问女士是否在搬入新房子时卖掉了所有的家具,女士回答说只卖掉了无用的家具,并计划只为客厅购买一套新家具。因此,女士的意思是...

    Manage Software Testing

    This book is written for:... At the back of my head I hear the voice of an awkward Highland-Scottish project manager asking, “Aye, but what does it buy me?” It’s a good question and this is an answer.

    英语口语之精华汇总.pdf

    / What does NATO mean? / What does NATO stand for?**(NATO代表什么?) - **How does "live" differ from "leave"?**("live"和"leave"有什么不同?) - **What's the difference between A and B?**(A和B有...

    Professional.MFC.with.VC6

    What Does it Really Mean? Documents About the Document Metaphor Data Storage Views CScrollView Control-based Views CFormView and CRecordView Rendering Your View Enumerating Views Managing ...

    英语句子结构主谓宾定状补及五个简单句PPT课件.pptx

    复合谓语是指由情态动词、助动词、不带to的动词不定式构成的,例如:“What does this word mean?”(这个单词是什么意思?),“I won’t do it again.”(我不会再做它)等。 四、表语 表语是英语句子结构的另一...

    四六级讲座之“高分导学”(何凯文)

    - 问题:What does the man mean? **解析:** 对话中女士希望找到了解巴尔的摩的人交谈,男士表示他在那里的时候还很小,所以无法提供有用的信息。因此,正确答案是B) He can provide little useful information,...

    六年级上册英语试题Unit1Publicsigns单元试卷牛津译林无答案word文档.docx

    - **询问标志含义**:What does this/that sign mean? It means “Danger”. - **表达不应该做某事**:You shouldn’t make noise/park/eat and drink. - **表达应该做某事**:You should keep quiet/keep off the ...

    iBT新托福口语常用100词汇.pdf

    (*On what page does it come?*) 2. **get** - **释义:** 表示获得、理解或达到某种状态。 - **例句:** - 我们可以收看到15个频道的电视节目。(*We can get 15 channels on TV.*) - 你明白我的意思吗?...

    Web Operations

    why does web operations have it tough? from apprentice to master conclusion 2 how picnik uses cloud computing: lessons learned justin huff where the cloud fits (and why!) where the cloud doesn't fit...

    Web Operations:Keep data on time(网站运维)

    why does web operations have it tough? from apprentice to master conclusion 2 how picnik uses cloud computing: lessons learned justin huff where the cloud fits (and why!) where the cloud doesn't fit...

    Docker for Serverless Applications-Packt Publishing(2018)

    What does this mean to us? Enterprise means stability, but startup means adventure. Let's move onto the new adventure, the post container—the serverless era. What we will be talking about in this ...

    流利口语850个基本词

    - 在哪一页:`On what page does it come?` - **get(得到、明白)** - 我们可以收看到15个频道的电视节目:`We can get 15 channels on TV.` - 你明白我的意思吗:`Do you get me?` - 啊!这下我可难到你啦:`...

    甘肃省民勤县第学2018 2019学年高二英语下学期第一次月考试题.doc

    2. What does the underlined word "dexterity" in Paragraph 4 probably mean?A. 大小B. 色彩C. 敏捷性D. 温度 3. What can we infer about the Keel-billed Toucan's lifestyle?A. It is a solitary bird that ...

Global site tag (gtag.js) - Google Analytics