{"id":26,"date":"2011-04-01T13:09:30","date_gmt":"2011-04-01T17:09:30","guid":{"rendered":"http:\/\/www.jintrang.com\/who-is-hu\/?p=26"},"modified":"2011-04-07T12:40:47","modified_gmt":"2011-04-07T16:40:47","slug":"whats-new-in-html5","status":"publish","type":"post","link":"https:\/\/www.jintrang.com\/who-is-hu\/2011\/04\/whats-new-in-html5\/","title":{"rendered":"What&#8217;s New In HTML5?"},"content":{"rendered":"<p>Being a good web developer means keeping up with the constantly evolving technology. One of the most fundamental building blocks of a webpage is HTML, HyperText Markup Language. Web browsers use HTML elements, written in the form of tags (open and close angle brackets) to interpret the content of the page. HTML is used to create forms, embed images and objects, and structure content. With the help of CSS (Cascading Style Sheets) and Javascript, webpages can be presented in clean, organized, and interactive eye-catching ways. Currently, the specifications of HTML4 are being used to render webpages across the web. As we transition into using HTML5, new semantics and elements are being added to the specifications. The biggest benefit of HTML5 is being able to help bridge the gap between the back-end principles of Javascript to the front-end layers of HTML.<\/p>\n<p>Below is a brief look on what&#8217;s new in HTML5.<\/p>\n<p>Starting from the top. The original DOCTYPE declaration of a website has been shortened to:<br \/>\n<strong>&lt;!DOCTYPE html&gt;<\/strong><br \/>\nIt&#8217;s so much easier to remember!<\/p>\n<p>Some new structural elements have been added to replace  some of the more commonly used DIV IDs and classes.<br \/>\n<strong>&lt;header&gt;<br \/>\n&lt;nav&gt;<br \/>\n&lt;section&gt;<br \/>\n&lt;article&gt;<br \/>\n&lt;aside&gt;<br \/>\n&lt;footer&gt;<\/strong>\n<\/p>\n<p>Markup Examples:<\/p>\n<p><strong>&lt;header&gt;<br \/>\n  &lt;h1&gt;Hello World and HTML5!&lt;\/h1&gt;<br \/>\n  &lt;p&gt;Lorem ipsum&#8230;.&lt;\/p&gt;<br \/>\n&lt;\/header&gt;<\/strong>\n<\/p>\n<p><strong>&lt;nav&gt;<br \/>\n  &lt;ul&gt;<br \/>\n    &lt;li&gt;&lt;a href=&#8221;#&#8221;&gt;Home&lt;\/a&gt;&lt;\/li&gt;<br \/>\n    &lt;li&gt;&lt;a href=&#8221;#&#8221;&gt;About&lt;\/a&gt;&lt;\/li&gt;<br \/>\n    &lt;li&gt;&lt;a href=&#8221;#&#8221;&gt;Contact&lt;\/a&gt;&lt;\/li&gt;<br \/>\n  &lt;\/ul&gt;<br \/>\n&lt;\/nav&gt;<\/strong><\/p>\n<p>HTML5 is breathing new life into web apps, from tablets to mobile. By extending the API, HTML5 gives web apps the capabilities of application caching and offline data storage. By specifying the manifest attribute to the html element. <strong>&lt;html manifest=&#8221;manifest.cache&#8221;&gt;<\/strong>, developers are able to control which files a browser should cache. Viewers can now avoid the hassle of reconnecting to the internet to browse a page that was previously displayed before. For more information on application caching, check out the <a href=\"http:\/\/www.webreference.com\/authoring\/languages\/html\/HTML5-Application-Caching\/\" title=\"HTML5 Application Caching\">Webreference<\/a> site.<\/p>\n<p>Video and audio APIs allow for easier embedding of such files. <br \/>\nFor example, the simplest way to embed a video is to use the new video element and allow the browser to provide a default UI with the controls attribute. The poster attribute is optional and allows for an image to be displayed in place of the video before playing.<strong> &lt;video controls width=&#8221;250&#8243; height=&#8221;150&#8243; src=&#8221;file.mp4&#8243; poster=&#8221;poster.jpg&#8221;&gt; <\/strong><br \/>Audio is just as simple, minus the attributes of width, height, and poster. <strong>&lt;audio src=&#8221;audio.mp3&#8243; controls&gt;&lt;\/audio&gt;<\/strong><\/p>\n<p>Probably the most interesting feature of HTML5 is the canvas element. One can finally dynamically generate graphics on a web page! The possibilities of using the canvas element is endless. Developers can now use canvas to build graphs, charts, animations, games, etc.<br \/>\n<strong>&lt;canvas id=&#8221;myCanvas&#8221; width=&#8221;200&#8243; height=&#8221;100&#8243;&gt;Display this text if browser doesn&#8217;t support canvas.&lt;\/canvas&gt;<\/strong> is the code used to create a canvas element.<\/p>\n<p>By using Javascript, the code below draws out a red rectangle.<br \/>\n<strong>&lt;script type=&#8221;text\/javascript&#8221;&gt;<br \/>\nvar example = document.getElementById(&#8216;example&#8217;);<br \/>\nvar context = example.getContext(&#8216;2d&#8217;);<br \/>\ncontext.fillStyle = &#8220;rgb(255,0,0)&#8221;;<br \/>\ncontext.fillRect(30, 30, 50, 50);<br \/>\n&lt;\/script&gt;<\/strong><\/p>\n<p>Visit <a href=\"http:\/\/www.w3schools.com\/html5\/html5_canvas.asp\" title=\"W3School HTML5 Canvas Tutorial\">w3school<\/a> for a tutorial on the new canvas element.<\/p>\n<p>This post was inspired by the new features of HTML5. Developers are already experimenting with HTML5. Not all browsers will display HTML5 content correctly. It&#8217;s just a matter of time when the majority of developers will code with the newly added features and when all latest version of browsers (even IE) will support it. For more references to HTML5, check out <a href=\"http:\/\/dev.w3.org\/html5\/html-author\/\" title=\"W3C Web Developer's Guide to HTML5\">W3C Web Developer&#8217;s Guide to HTML5<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Being a good web developer means keeping up with the constantly evolving technology. One of the most fundamental building blocks of a webpage is HTML, HyperText Markup Language. Web browsers use HTML elements, written in the form of tags (open and close angle brackets) to interpret the content of the page. HTML is used to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-26","post","type-post","status-publish","format-standard","hentry","category-professional"],"_links":{"self":[{"href":"https:\/\/www.jintrang.com\/who-is-hu\/wp-json\/wp\/v2\/posts\/26","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jintrang.com\/who-is-hu\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jintrang.com\/who-is-hu\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jintrang.com\/who-is-hu\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jintrang.com\/who-is-hu\/wp-json\/wp\/v2\/comments?post=26"}],"version-history":[{"count":11,"href":"https:\/\/www.jintrang.com\/who-is-hu\/wp-json\/wp\/v2\/posts\/26\/revisions"}],"predecessor-version":[{"id":37,"href":"https:\/\/www.jintrang.com\/who-is-hu\/wp-json\/wp\/v2\/posts\/26\/revisions\/37"}],"wp:attachment":[{"href":"https:\/\/www.jintrang.com\/who-is-hu\/wp-json\/wp\/v2\/media?parent=26"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jintrang.com\/who-is-hu\/wp-json\/wp\/v2\/categories?post=26"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jintrang.com\/who-is-hu\/wp-json\/wp\/v2\/tags?post=26"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}