有些人接受了 ,有些人丟棄它太遙遠的未來,有些人放棄了濫用的朋友有利于舊火焰在籌備。任何一方的辯論你的,你最有可能聽到的所有的博客聊天圍繞“新炎熱” ,也就是html5 。它無處不在,它的未來,和你想知道的一切,您可以收到的舊新聞。
像jquery插件,格式技術,并設計趨勢的變化非常迅速地在整個網絡社會。并在大多數情況下我們都接受的是,有些事情我們知道今天可以過時的明天,但是這是我們行業的性質。
在尋找一些穩定,我們通常可以轉向代碼本身,因為它往往會保持不變了很長一段時間(相對而言) 。因此,當一些驚喜和改變我們的代碼,這是一個大問題,以及將有一些成長的痛苦,我們必須通過。幸運的是,據傳,我們已經少了一個變化的擔心 。
在這篇文章中,我希望能夠給你一些提示和洞察html5 ,以幫助減輕疼痛的必然附帶過渡到一種略有不同的語法。
welcome to html5.
when i first started researching html5 a few months ago, one of the main things i struggled to find was the doctype. a simple thing, you’d think it would be everywhere, but after much frustration, i finally found it buried within w3.org and here it is:
<!doctype html>
我也好奇,為什么他們選擇“的html ” ,而不是“ html5 ” ,這似乎合乎邏輯的方式來告訴瀏覽器,目前的文件寫于html5 ,并提供了一個良好的范本,以供未來。但我發現, <!doctype html5>觸發夸克斯模式中的ie6 ,和向后兼容時,考慮到<!doctype html>是一個相當不錯的選擇(在我看來) 。
總之,我真的很喜歡這個新的文檔,它的小的,有意義的,也許我們會實際上能夠記住這個時刻的心,而不是將其粘貼在網站上。
at first glance, with html5, the new elements immediately jump out and command attention. the w3c really listened to the community and planned for the future when architecting the abundance of new elements available. we have everything from basic structural elements like <header>
and <footer>
to others like <canvas>
and <audio>
that tap into, what seems to be, a very powerful api which allows us the freedom to create more user-friendly applications while further distancing ourselves from reliance on flash for saving data and intense animation.
<header>
<nav>
<section>
<div>
does by separating off a portion of the document. <article>
<aside>
<footer>
when you take a look at these new elements, it looks like they’re just replacing our common div ids; and in a way, it’s true. but, the diagram below shows that elements like <header>
and <footer>
can be used more than once on a single page where they behave more like classes and normal html elements that you can use over and over again to retain a semantic structure.
elements like <header> and <footer> are not just meant to represent the top and bottom of the current document, but they also represent the <header>
and <footer>
of each document section, much the way we use <thead>
and <tfoot>
in data tables.
the benefits of using these structural elements is mainly due to the fact that they are extremely well defined and provide a great way to semantically structure your document. however, these elements do need to be used with some careful thought because they can, very easily be overused.
even though html 4.01, xhtml 1.0, & html5 are all very similar there are some small syntax differences that can, very easily, slip past anyone and invalidate code. keeping this in mind, html5 has some built-in “slack” to make the transition a little easier.
for example, when marking up a form in html5, this is the proper syntax for an input text element:
<input type="text" id="name">
but this is also accepted as valid code in an attempt to ease the pain for avid xhtml coders (like myself) who are used to self-closing elements:
<input type="text" id="name"/>
the same rules apply to <meta>
and other self closing elements. legacy elements like <b>
and <i>
were also left in to help those coming over from html 4.01.l
with any new technology there has to be benefit; why else would you use it? if your old code works just as well and efficient as the new code there’s no reason to upgrade. no reason at all, trust me, i checked.
luckily html5 is packed with cool new features, code slimming techniques and a lot of stuff i would call very large benefits. most of which circle around the new apis and the dom tree.
|
新聞熱點
疑難解答