国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > HTML5 > 正文

HTML5與未來的網頁設計(英文教程)

2024-09-05 07:11:30
字體:
來源:轉載
供稿:網友

有些人接受了 ,有些人丟棄它太遙遠的未來,有些人放棄了濫用的朋友有利于舊火焰在籌備。任何一方的辯論你的,你最有可能聽到的所有的博客聊天圍繞“新炎熱” ,也就是html5 。它無處不在,它的未來,和你想知道的一切,您可以收到的舊新聞。

像jquery插件,格式技術,并設計趨勢的變化非常迅速地在整個網絡社會。并在大多數情況下我們都接受的是,有些事情我們知道今天可以過時的明天,但是這是我們行業的性質。

在尋找一些穩定,我們通??梢赞D向代碼本身,因為它往往會保持不變了很長一段時間(相對而言) 。因此,當一些驚喜和改變我們的代碼,這是一個大問題,以及將有一些成長的痛苦,我們必須通過。幸運的是,據傳,我們已經少了一個變化的擔心 。

在這篇文章中,我希望能夠給你一些提示和洞察html5 ,以幫助減輕疼痛的必然附帶過渡到一種略有不同的語法。

 

welcome to html5.

html5 logo

what are the basics?

the doctype

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>是一個相當不錯的選擇(在我看來) 。

總之,我真的很喜歡這個新的文檔,它的小的,有意義的,也許我們會實際上能夠記住這個時刻的心,而不是將其粘貼在網站上。

 

new elements you should know

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.

the new structural elements
  • <header>
    the header element contains introductory information to a section or page. this can involve anything from our normal documents headers (branding information) to an entire table of contents.
  • <nav>
    the nav element is reserved for a section of a document that contains links to other pages or links to sections of the same page. not all link groups need to be contained within the <nav> element, just primary navigation.
  • <section>
    the section element represents a generic document or application section. it acts much the same way a <div> does by separating off a portion of the document.
  • <article>
    the article element represents a portion of a page which can stand alone such as: a blog post, a forum entry, user submitted comments or any independent item of content.
  • <aside>
    aside, represents content related to the main area of the document. this is usually expressed in sidebars that contain elements like related posts, tag clouds, etc. they can also be used for pull quotes.
  • <footer>
    the footer element is for marking up the footer of, not only the current page, but each section contained in the page. so, it’s very likely that you’ll be using the <footer> element multiple times within one page.

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.

html5 structure doc

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.

further reading on structural html5
  • steve smith on structural tags in html5
  • lachlan hunt’s preview of html5
  • elliot harold on new elements in html5
  • bruce lawson’s html5 form demo

easing the transition from xhtml

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

what are the benefits?

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.

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 保山市| 河北区| 永顺县| 白银市| 寿宁县| 张北县| 府谷县| 勐海县| 民县| 呼和浩特市| 如皋市| 巨鹿县| 获嘉县| 灌阳县| 且末县| 大名县| 延川县| 科技| 拜泉县| 侯马市| 宜兰县| 即墨市| 康乐县| 墨竹工卡县| 泽库县| 东辽县| 额敏县| 长治县| 象山县| 饶河县| 东明县| 吉首市| 吉木萨尔县| 高邮市| 三明市| 蒲城县| 西城区| 丰城市| 玛纳斯县| 商丘市| 黄大仙区|