{"id":6322,"date":"2015-08-25T10:35:49","date_gmt":"2015-08-25T07:35:49","guid":{"rendered":"http:\/\/www.webcodegeeks.com\/?p=6322"},"modified":"2018-06-19T23:22:46","modified_gmt":"2018-06-19T20:22:46","slug":"html5-boilerplate-framework-tutorial","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/html5\/html5-boilerplate-framework-tutorial\/","title":{"rendered":"HTML5 Boilerplate Framework Tutorial"},"content":{"rendered":"<p>In this article, we&#8217;ll be going through a very popular HTML5 framework, maybe the most popular one, HTML5 Boilerplate.<\/p>\n<p>HTML5 Boilerplate helps you build fast, robust, and adaptable web apps or sites. This project is the product of many years of iterative development and combined community knowledge. It does not impose a specific development philosophy or framework, so you&#8217;re free to architect your code in the way that you want.<\/p>\n<p>You can find the source code in the official github repository: <a href=\"https:\/\/github.com\/h5bp\/html5-boilerplate\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/h5bp\/html5-boilerplate<\/a><\/p>\n<p>[ulp id=&#8217;tgm4cmEWcKUikZNn&#8217;]<\/p>\n<h2>1. Main Features<\/h2>\n<p>You might be wondering, why use Boilerplate, what&#8217;s on it? Well, below we present the best features:<\/p>\n<p>&#8211; HTML5 ready. Use the new elements with confidence.<br \/>\n&#8211; Designed with progressive enhancement in mind.<\/p>\n<p>Includes:<br \/>\n&#8211; <code>Normalize.css<\/code> for CSS normalizations and common bug fixes<br \/>\n&#8211; <code>jQuery<\/code> via CDN, with a local fallback<br \/>\n&#8211; A custom build of <code>Modernizr<\/code> for feature detection<br \/>\n&#8211; <code>Apache Server Configs<\/code> that, among other, improve the web site&#8217;s performance and security<br \/>\n&#8211; Placeholder CSS Media Queries.<br \/>\n&#8211; Useful CSS helper classes.<br \/>\n&#8211; Default print styles, performance optimized.<br \/>\n&#8211; An optimized version of the Google Universal Analytics snippet.<br \/>\n&#8211; Protection against any stray console statements causing JavaScript errors in older browsers.<br \/>\n&#8211; &#8220;Delete-key friendly.&#8221; Easy to strip out parts you don&#8217;t need.<br \/>\n&#8211; Extensive inline and accompanying documentation.<\/p>\n<h2>2. Browser Support<\/h2>\n<p>Browser support is a very important aspect to consider when developing web projects. Boilerplate offers a wide range of browser support and even support for their earlier versions.<\/p>\n<p>&#8211; Chrome (latest 2)<br \/>\n&#8211; Firefox (latest 2)<br \/>\n&#8211; Internet Explorer 8+<br \/>\n&#8211; Opera (latest 2)<br \/>\n&#8211; Safari (latest 2)<\/p>\n<p>This doesn&#8217;t mean that HTML5 Boilerplate cannot be used in older browsers, just that they&#8217;ll ensure compatibility with the ones mentioned above.<\/p>\n<h2>3. The HTML of Boilerplate<\/h2>\n<p>By default, HTML5 Boilerplate provides two <code>html<\/code> pages:<br \/>\n1. <code>index.html<\/code> &#8211; a default HTML skeleton that should form the basis of all pages on your website.<br \/>\n2. <code>404.html<\/code> &#8211; a placeholder 404 error page.<\/p>\n<h3>3.1 Inside <code>index.html<\/code><\/h3>\n<p><strong>The <code>no-js<\/code> class<\/strong><br \/>\nThe <code>no-js<\/code> class is provided in order to allow you to more easily and explicitly add custom styles based on whether JavaScript is disabled (.no-js) or enabled (.js). Using this technique also helps avoid the FOUC.<\/p>\n<p><strong>Language attribute<\/strong><br \/>\nDo consider specifying the language of your content by adding the lang attribute to as in this example:<br \/>\n&lt;html class=&#8221;no-js&#8221; lang=&#8221;en&#8221;&gt;<\/p>\n<p><strong>The order of the &lt;title&gt; and &lt;meta&gt; tags<\/strong><\/p>\n<p>The order in which the &lt;title&gt; and the &lt;meta&gt; tags are specified is important because:<\/p>\n<p>1) the charset declaration (&lt;meta charset=&#8221;utf-8&#8243;&gt;):<\/p>\n<p>&#8211; must be included completely within the first 1024 bytes of the document<\/p>\n<p>&#8211; should be specified as early as possible (before any content that could be controlled by an attacker, such as a &lt;title&gt; element) in order to avoid a potential encoding-related security issue in Internet Explorer<\/p>\n<p>2) the meta tag for compatibility mode (&lt;meta http-equiv=&#8221;x-ua-compatible&#8221; content=&#8221;ie=edge&#8221;&gt;):<\/p>\n<p>&#8211; needs to be included before all other tags except for the &lt;title&gt; and the other &lt;meta&gt; tags<\/p>\n<p><strong>x-ua-compatible<\/strong><\/p>\n<p>Internet Explorer 8\/9\/10 support document compatibility modes that affect the way webpages are interpreted and displayed. Because of this, even if your site&#8217;s visitor is using, let&#8217;s say, Internet Explorer 9, it&#8217;s possible that IE will not use the latest rendering engine, and instead, decide to render your page using the Internet Explorer 5.5 rendering engine.<\/p>\n<p>Specifying the <code>x-ua-compatible<\/code> meta tag:<\/p>\n<p>or sending the page with the following HTTP response header<\/p>\n<p><code>X-UA-Compatible: IE=edge<\/code><br \/>\nwill force Internet Explorer 8\/9\/10 to render the webpage in the highest available mode in the various cases when it may not, and therefore, ensure that anyone browsing your site is treated to the best possible user experience that browser can offer.<\/p>\n<p>If possible, we recommend that you remove the <code>meta<\/code> tag and send only the HTTP response header as the <code>meta<\/code> tag will not always work if your site is served on a non-standard port, as Internet Explorer&#8217;s preference option <strong>Display intranet sites in Compatibility View<\/strong> is checked by default.<\/p>\n<p>If you are using Apache as your webserver, including the <em>.htaccess<\/em> file takes care of the HTTP header. If you are using a different server, check out our other server config.<\/p>\n<p><strong>Mobile viewport<\/strong><\/p>\n<p>There are a few different options that you can use with the <code>viewport<\/code> meta tag. You can find out more in the Apple developer docs. HTML5 Boilerplate comes with a simple setup that strikes a good balance for general use cases.<\/p>\n<pre class=\"brush:xml\">&lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"&gt;<\/pre>\n<p><strong>Modernizr<\/strong><\/p>\n<p>HTML5 Boilerplate uses a custom build of Modernizr.<\/p>\n<p>Modernizr is a JavaScript library which adds classes to the <code>html<\/code> element based on the results of feature test and which ensures that all browsers can make use of HTML5 elements (as it includes the HTML5 Shiv). This allows you to target parts of your CSS and JavaScript based on the features supported by a browser.<\/p>\n<p>In general, in order to keep page load times to a minimum, it&#8217;s best to call any JavaScript at the end of the page because if a script is slow to load from an external server it may cause the whole page to hang. That said, the Modernizr script needs to run before the browser begins rendering the page, so that browsers lacking support for some of the new HTML5 elements are able to handle them properly. Therefore the Modernizr script is the only JavaScript file synchronously loaded at the top of the document.<\/p>\n<p><strong>What about polyfills?<\/strong><\/p>\n<p>A polyfill, or polyfiller, is a piece of code (or plugin) that provides the technology that you, the developer, expect the browser to provide natively. Flattening the API landscape if you will. If you need to include polyfills in your project, you must make sure those load before any other JavaScript. If you&#8217;re using some polyfill CDN service.<\/p>\n<pre class=\"brush:xml\"> \r\n    \r\n    window.jQuery || document.write('')\r\n    \r\n    \r\n\r\n<\/pre>\n<p><strong>The content area<\/strong><\/p>\n<p>The central part of the boilerplate template is pretty much empty. This is intentional, in order to make the boilerplate suitable for both web page and web app development.<\/p>\n<p><strong>Google CDN for jQuery<\/strong><\/p>\n<p>The Google CDN version of the jQuery JavaScript library is referenced towards the bottom of the page using a protocol-independent path (read more about this in the FAQ). A local fallback of jQuery is included for rare instances when the CDN version might not be available, and to facilitate offline development.<\/p>\n<p>The Google CDN version is chosen over other potential candidates (like the jQuery CDN) because it&#8217;s fast in absolute terms and it has the best overall penetration which increases the odds of having a copy of the library in your user&#8217;s browser cache.<\/p>\n<p>While the Google CDN is a strong default solution your site or application may require a different configuration. Testing your site with services like WebPageTest and browser tools like PageSpeed Insights or YSlow will help you examine the real world performance of your site and can show where you can optimize your specific site or application.<\/p>\n<p><strong>Google Universal Analytics Tracking Code<\/strong><\/p>\n<p>Finally, an optimized version of the Google Universal Analytics tracking code is included. Google recommends that this script be placed at the top of the page. Factors to consider: if you place this script at the top of the page, you\u2019ll be able to count users who don\u2019t fully load the page, and you\u2019ll incur the max number of simultaneous connections of the browser.<\/p>\n<p>Finally, this is how the HTML of Boilerplate looks like in your editor:<\/p>\n<figure id=\"attachment_6342\" aria-describedby=\"caption-attachment-6342\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/08\/boilerplate1.jpg\"><img decoding=\"async\" class=\"wp-image-6342 size-full\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/08\/boilerplate1.jpg\" alt=\"The HTML5 Boilerplate Framework\" width=\"820\" height=\"764\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/08\/boilerplate1.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/08\/boilerplate1-300x280.jpg 300w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-6342\" class=\"wp-caption-text\">The HTML of Boilerplate Framework<\/figcaption><\/figure>\n<h2>4. The CSS of Boilerplate<\/h2>\n<p>HTML5 Boilerplate&#8217;s CSS includes:<br \/>\n\u2022 Normalize.css<br \/>\n\u2022 Useful defaults<br \/>\n\u2022 Common helpers<br \/>\n\u2022 Placeholder media queries<br \/>\n\u2022 Print styles<\/p>\n<p>This starting CSS does not rely on the presence of conditional class names, conditional style sheets, or Modernizr, and it is ready to use no matter what your development preferences happen to be.<\/p>\n<h3>4.1 Normalize.css<\/h3>\n<p>In order to make browsers render all elements more consistently and in line with modern standards, we include Normalize.css \u2014 a modern, HTML5-ready alternative to CSS resets.<\/p>\n<p>As opposed to CSS resets, Normalize.css:<\/p>\n<p>\u2022 targets only the styles that need normalizing<br \/>\n\u2022 preserves useful browser defaults rather than erasing them<br \/>\n\u2022 corrects bugs and common browser inconsistencies<br \/>\n\u2022 improves usability with subtle improvements<br \/>\n\u2022 doesn&#8217;t clutter the debugging tools<br \/>\n\u2022 has better documentation<\/p>\n<h3>4.2 Useful defaults<\/h3>\n<p>Several base styles are included that build upon Normalize.css. These styles:<\/p>\n<p>\u2022 provide basic typography settings that improve text readability<br \/>\n\u2022 protect against unwanted text-shadow during text highlighting<br \/>\n\u2022 tweak the default alignment of some elements (e.g.: img, video, fieldset, textarea)<br \/>\n\u2022 style the prompt that is displayed to users using an outdated browser<\/p>\n<p>You are free and even encouraged to modify or add to these base styles as your project requires.<\/p>\n<h3>4.3 Common Helpers<\/h3>\n<p>Along with the base styles, we also provide some commonly used helper classes.<\/p>\n<p><code>.hidden<\/code><br \/>\nThe <code>hidden<\/code> class can be added to any element that you want to hide visually and from screen readers. It could be an element that will be populated and displayed later, or an element you will hide with JavaScript.<\/p>\n<p><code>.visuallyhidden<\/code><br \/>\nThe <code>visuallyhidden<\/code> class can be added to any element that you want to hide visually, while still have its content accessible to screen readers.<\/p>\n<p><code>.invisible<\/code><br \/>\nThe <code>invisible<\/code> class can be added to any element that you want to hide visually and from screen readers, but without affecting the layout.<\/p>\n<p>As opposed to the hidden class that effectively removes the element from the layout, the invisible class will simply make the element invisible while keeping it in the flow and not affecting the positioning of the surrounding content.<\/p>\n<p><code>.clearfix<\/code><br \/>\nThe <code>clearfix<\/code> class can be added to any element to ensure that it always fully contains its floated children.<\/p>\n<p>Over the years there have been many variants of the clearfix hack, but currently, we use the micro clearfix.<\/p>\n<h3>4.4 Media Queries<\/h3>\n<p>HTML5 Boilerplate makes it easy for you to get started with a <em>mobile first<\/em> and <em>responsive web design<\/em> approach to development. But it&#8217;s worth remembering that there are no silver bullets.<\/p>\n<p>We include placeholder media queries to help you build up your mobile styles for wider viewports and high-resolution displays. It&#8217;s recommended that you adapt these media queries based on the content of your site rather than mirroring the fixed dimensions of specific devices.<\/p>\n<p>If you do not want to take the mobile first approach, you can simply edit or remove these placeholder media queries. One possibility would be to work from wide viewports down, and use <code>max-width<\/code> media queries instead (e.g.: <code>@media only screen and (max-width: 480px)<\/code>).<\/p>\n<h3>4.5 Print styles<\/h3>\n<p>Lastly, we provide some useful print styles that will optimize the printing process, as well as make the printed pages easier to read.<\/p>\n<p>At printing time, these styles will:<\/p>\n<p>\u2022 strip all background colors, change the font color to black, and remove the text-shadow \u2014 done in order to help save printer ink and speed up the printing process<br \/>\n\u2022 underline and expand links to include the URL \u2014 done in order to allow users to know where to refer to<br \/>\n(exceptions to this are: the links that are fragment identifiers, or use the javascript: pseudo protocol)<br \/>\n\u2022 expand abbreviations to include the full description \u2014 done in order to allow users to know what the abbreviations stands for<br \/>\n\u2022 provide instructions on how browsers should break the content into pages and on orphans\/widows, namely, we instruct supporting browsers that they should:<\/p>\n<p>\u2080 ensure the table header (<\/p>\n<p>) is printed on each page spanned by the table\u00a0\u00a0\u00a0\u2080 prevent block quotations, preformatted text, images and table rows from being split onto two different pages\u00a0\u00a0\u00a0\u2080 ensure that headings never appear on a different page than the text they are associated with\u00a0\u00a0\u00a0\u2080 ensure that orphans and widows do not appear on printed pages.<\/p>\n<h2>5. The Javascript of Boilerplate<\/h2>\n<h3>5.1 <strong>main.js<\/strong><\/h3>\n<p>This file can be used to contain or reference your site\/app JavaScript code. For larger projects, you can make use of a JavaScript module loader, like Require.js, to load any other scripts you need to run.<\/p>\n<h3>5.2 <strong>plugins.js<\/strong><\/h3>\n<p>This file can be used to contain all your plugins, such as jQuery plugins and other 3rd party scripts.<\/p>\n<p>One approach is to put jQuery plugins inside of a <code>(function($){ ... })(jQuery);<\/code> closure to make sure they&#8217;re in the jQuery namespace safety blanket. Read more about jQuery plugin authoring.<\/p>\n<p>By default the plugins.js file contains a small script to avoid console errors in browsers that lack a <code>console<\/code>. The script will make sure that, if a console method isn&#8217;t available, that method will have the value of empty function, thus, preventing the browser from throwing an error.<\/p>\n<h2>6. Using the Framework<\/h2>\n<p>The folder structure of Boilerplate is this:<br \/>\n\u251c\u2500\u2500 css<br \/>\n\u2502 \u251c\u2500\u2500 main.css<br \/>\n\u2502 \u2514\u2500\u2500 normalize.css<br \/>\n\u251c\u2500\u2500 doc<br \/>\n\u251c\u2500\u2500 img<br \/>\n\u251c\u2500\u2500 js<br \/>\n\u2502 \u251c\u2500\u2500 main.js<br \/>\n\u2502 \u251c\u2500\u2500 plugins.js<br \/>\n\u2502 \u2514\u2500\u2500 vendor<br \/>\n\u2502 \u251c\u2500\u2500 jquery.min.js<br \/>\n\u2502 \u2514\u2500\u2500 modernizr.min.js<br \/>\n\u251c\u2500\u2500 .htaccess<br \/>\n\u251c\u2500\u2500 404.html<br \/>\n\u251c\u2500\u2500 index.html<br \/>\n\u251c\u2500\u2500 humans.txt<br \/>\n\u251c\u2500\u2500 robots.txt<br \/>\n\u251c\u2500\u2500 crossdomain.xml<br \/>\n\u251c\u2500\u2500 favicon.ico<br \/>\n\u2514\u2500\u2500 [apple-touch-icons]<\/p>\n<h3>6.1 Popular boilerplates<\/h3>\n<p>HTML5 Boilerplate is a good place to start. The self-described &#8220;web&#8217;s most popular front-end template&#8221; is sleek, simple and the result of the pooled knowledge of many dozens of developers. It provides the basic scaffolding or framework for building an entire website.<\/p>\n<p>There are alternative methods, which happen to provide more assistance. Bootstrap, Web Starter Kit and Skeleton add things like a typography base and responsive grid, giving you a further head-start when working on your design. However, they do so at the expense of additional default code, which you may find yourself having to edit or override.<\/p>\n<p>There are also arguments that rather too many designers in recent years have relied heavily on Bootstrap, thereby resulting in many sites looking alike. Using a simpler foundation and going your own way could therefore be a better choice, depending on your level of ability, confidence and needs.<\/p>\n<h3>6.2 Advanced boilerplates<\/h3>\n<p>Based on HTLM5 Boilerplate, Initializr generates a clean customizable template for you<\/p>\n<figure id=\"attachment_6351\" aria-describedby=\"caption-attachment-6351\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/08\/boilerplate2.jpg\"><img decoding=\"async\" class=\"wp-image-6351 size-full\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/08\/boilerplate2.jpg\" alt=\"Initializr HTML5 Boilerplate\" width=\"820\" height=\"764\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/08\/boilerplate2.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/08\/boilerplate2-300x280.jpg 300w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-6351\" class=\"wp-caption-text\">Initializr<\/figcaption><\/figure>\n<p>Once you gain experience, it&#8217;s worth considering a custom build using Initializr, retaining the components you need and ditching those you don&#8217;t. Also, if you&#8217;re creating a WordPress site, explore a WordPress-specific blank theme, such as HTML5 Blank.<\/p>\n<p>These downloads and services are all free, and so you can check out and experiment with them at your leisure. For now, though, we&#8217;re going to concentrate on HTML5 Boilerplate.<\/p>\n<h3>6.3 Usage of the HTML5 Boilerplate<\/h3>\n<p>This free, open-source boilerplate when downloaded provides you with documentation and licensing in Markdown format, some CSS, two placeholder images, two HTML files, some JavaScript, and some server config files.<\/p>\n<p>On downloading the archive, make a copy and keep it clean and untouched. It can then serve as reference for any changes you make. For the new site you&#8217;re working on, you can ditch all of the .md documents. You&#8217;ll also want to replace the two .png files with your own, otherwise the HTML5 Boilerplate logo will appear as your site&#8217;s favicon and also the icon when your site is saved to someone&#8217;s iOS Home screen. An online generator can help you create new images.<\/p>\n<p>Regarding the HTML, there might be some things in there that you&#8217;re not familiar with. The majority of these additions deal with issues relating to legacy browsers; the final script element is for Google Analytics and can be removed entirely if you don&#8217;t use that. Leave the other script elements that are found towards the end of the file, because they load jQuery.<\/p>\n<p>Otherwise, beyond adding content to the body of the document, after the &#8216;Add your site or application content here&#8217; comment, you&#8217;ll need to give the page a title and fill the &#8216;content&#8217; value in the &#8216;description&#8217; meta tag.<\/p>\n<p>Pretty straight forward, you download the framework files, which you can consider as a template, and then edit the necessary files to get you project going.<\/p>\n<p>So I went ahead and added some lines into the main <strong>index.html<\/strong> and then edited the <strong>main.css<\/strong> inside <em>css<\/em> folder to customize my little page. The result was really great, considering that I didn&#8217;t have to write lines of code about linking assets, or any other type of declaration. I just added my code like so:<\/p>\n<p>&#8211; <strong>HTML<\/strong><br \/>\nThe HTML contains a heading div, a subheading, a paragraph and an image. It is all wrapped in one <code>wrapper<\/code> div, inside of which we have the main <code>heading1<\/code> div and a <code>content<\/code> div. Note the actual code is put under the body section, and the template default code remains unchanged. Isn&#8217;t that awesome?<\/p>\n<figure id=\"attachment_6354\" aria-describedby=\"caption-attachment-6354\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/08\/boilerplate3.jpg\"><img decoding=\"async\" class=\"wp-image-6354 size-full\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/08\/boilerplate3.jpg\" alt=\"Adding your HTML5 Boilerplate index.html\" width=\"820\" height=\"889\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/08\/boilerplate3.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/08\/boilerplate3-277x300.jpg 277w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-6354\" class=\"wp-caption-text\">Adding your HTML to Boilerplate&#8217;s index.html<\/figcaption><\/figure>\n<p>&#8211; <strong>CSS<\/strong><br \/>\nAdding your own CSS will give the page styling, so in the framework CSS file I&#8217;ve added styles to enlarge the heading div, make it bold and give it a gray color. The wrapper got a centered look and a round padding. I also changed the paragraph text style to italic and gave it a green color. As you can notice, the image only has a soft shadow added.<\/p>\n<figure id=\"attachment_6356\" aria-describedby=\"caption-attachment-6356\" style=\"width: 470px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/08\/boilerplate4.jpg\"><img decoding=\"async\" class=\"wp-image-6356 size-full\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/08\/boilerplate4.jpg\" alt=\"Editing the Default main.css of HTML5 Boilerplate\" width=\"470\" height=\"777\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/08\/boilerplate4.jpg 470w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/08\/boilerplate4-181x300.jpg 181w\" sizes=\"(max-width: 470px) 100vw, 470px\" \/><\/a><figcaption id=\"caption-attachment-6356\" class=\"wp-caption-text\">Editing the Default main.css of Boilerplate<\/figcaption><\/figure>\n<p>This is how my page looked like in the browser:<\/p>\n<figure id=\"attachment_6357\" aria-describedby=\"caption-attachment-6357\" style=\"width: 820px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/08\/boilerplate5.jpg\"><img decoding=\"async\" class=\"wp-image-6357 size-full\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/08\/boilerplate5.jpg\" alt=\"Final Result of the Website using the HTML5 Boilerplate Framework\" width=\"820\" height=\"777\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/08\/boilerplate5.jpg 820w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/08\/boilerplate5-300x284.jpg 300w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><\/a><figcaption id=\"caption-attachment-6357\" class=\"wp-caption-text\">Final Result of the Website using the Framework<\/figcaption><\/figure>\n<p>Simple as that, nothing changed, just added my own content and enjoyed fast and reliable coding.<\/p>\n<h2>7. Conclusion<\/h2>\n<p>To conclude, HTML5 Boilerplate is a very basic but powerful HTML framework that enables distraction free coding, you already have all your assets linked (css and js) and all you do is start coding the body (the main part) of your web project. You can keep on adding the various snippets in css and js files provided and never have to worry about linking, mobile scaling, browser support and so on.<\/p>\n<p>In a nutshell, Boilerplate is a lean, mobile-friendly HTML template with optimized Google Analytics snippet, placeholder touch-device icon; and docs covering dozens of extra tips and tricks. Feel free to visit the official site: <a href=\"https:\/\/html5boilerplate.com\/\" target=\"_blank\" rel=\"noopener\">https:\/\/html5boilerplate.com\/<\/a><\/p>\n<h2>8. Download<\/h2>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example and the Boileplate framework files here:<br \/>\n<a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2015\/08\/HTML5-Boilerplate-Framework.zip\"><strong>HTML5 Boilerplate Framework<\/strong><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we&#8217;ll be going through a very popular HTML5 framework, maybe the most popular one, HTML5 Boilerplate. HTML5 Boilerplate helps you build fast, robust, and adaptable web apps or sites. This project is the product of many years of iterative development and combined community knowledge. It does not impose a specific development philosophy &hellip;<\/p>\n","protected":false},"author":75,"featured_media":914,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[227],"class_list":["post-6322","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-html5","tag-boilerplate"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>HTML5 Boilerplate Framework Tutorial - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"Interested to learn more about HTML5 Boilerplate Framework? Then check out our Tutorial where we explain why is a very basic but powerful HTML framework!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webcodegeeks.com\/html5\/html5-boilerplate-framework-tutorial\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"HTML5 Boilerplate Framework Tutorial - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"Interested to learn more about HTML5 Boilerplate Framework? Then check out our Tutorial where we explain why is a very basic but powerful HTML framework!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/html5\/html5-boilerplate-framework-tutorial\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/fabiocimo\" \/>\n<meta property=\"article:published_time\" content=\"2015-08-25T07:35:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-06-19T20:22:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Fabio Cimo\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@fabiocimo\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Fabio Cimo\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"15 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-boilerplate-framework-tutorial\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-boilerplate-framework-tutorial\/\"},\"author\":{\"name\":\"Fabio Cimo\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/1dfb88b4a8d08c37a6080311fd330a22\"},\"headline\":\"HTML5 Boilerplate Framework Tutorial\",\"datePublished\":\"2015-08-25T07:35:49+00:00\",\"dateModified\":\"2018-06-19T20:22:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-boilerplate-framework-tutorial\/\"},\"wordCount\":3004,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-boilerplate-framework-tutorial\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg\",\"keywords\":[\"Boilerplate\"],\"articleSection\":[\"HTML5\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/html5\/html5-boilerplate-framework-tutorial\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-boilerplate-framework-tutorial\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-boilerplate-framework-tutorial\/\",\"name\":\"HTML5 Boilerplate Framework Tutorial - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-boilerplate-framework-tutorial\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-boilerplate-framework-tutorial\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg\",\"datePublished\":\"2015-08-25T07:35:49+00:00\",\"dateModified\":\"2018-06-19T20:22:46+00:00\",\"description\":\"Interested to learn more about HTML5 Boilerplate Framework? Then check out our Tutorial where we explain why is a very basic but powerful HTML framework!\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-boilerplate-framework-tutorial\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/html5\/html5-boilerplate-framework-tutorial\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-boilerplate-framework-tutorial\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-boilerplate-framework-tutorial\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"HTML5\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/html5\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"HTML5 Boilerplate Framework Tutorial\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/1dfb88b4a8d08c37a6080311fd330a22\",\"name\":\"Fabio Cimo\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b3df055f2e1b62e238889fafbb16121c68aab1adcd11af670e185cafae201b3b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b3df055f2e1b62e238889fafbb16121c68aab1adcd11af670e185cafae201b3b?s=96&d=mm&r=g\",\"caption\":\"Fabio Cimo\"},\"description\":\"Fabio is a passionate student in web tehnologies including front-end (HTML\/CSS) and web design. He likes exploring as much as possible about the world wide web and how it can be more productive for us all. Currently he studies Computer Engineering, at the same time he works as a freelancer on both web programming and graphic design.\",\"sameAs\":[\"https:\/\/www.facebook.com\/fabiocimo\",\"https:\/\/al.linkedin.com\/in\/fabiocimo\",\"https:\/\/x.com\/fabiocimo\",\"https:\/\/www.youtube.com\/fabiocimo1\"],\"url\":\"https:\/\/www.webcodegeeks.com\/author\/fabio-cimo\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"HTML5 Boilerplate Framework Tutorial - Web Code Geeks - 2026","description":"Interested to learn more about HTML5 Boilerplate Framework? Then check out our Tutorial where we explain why is a very basic but powerful HTML framework!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webcodegeeks.com\/html5\/html5-boilerplate-framework-tutorial\/","og_locale":"en_US","og_type":"article","og_title":"HTML5 Boilerplate Framework Tutorial - Web Code Geeks - 2026","og_description":"Interested to learn more about HTML5 Boilerplate Framework? Then check out our Tutorial where we explain why is a very basic but powerful HTML framework!","og_url":"https:\/\/www.webcodegeeks.com\/html5\/html5-boilerplate-framework-tutorial\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_author":"https:\/\/www.facebook.com\/fabiocimo","article_published_time":"2015-08-25T07:35:49+00:00","article_modified_time":"2018-06-19T20:22:46+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg","type":"image\/jpeg"}],"author":"Fabio Cimo","twitter_card":"summary_large_image","twitter_creator":"@fabiocimo","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Fabio Cimo","Est. reading time":"15 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-boilerplate-framework-tutorial\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-boilerplate-framework-tutorial\/"},"author":{"name":"Fabio Cimo","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/1dfb88b4a8d08c37a6080311fd330a22"},"headline":"HTML5 Boilerplate Framework Tutorial","datePublished":"2015-08-25T07:35:49+00:00","dateModified":"2018-06-19T20:22:46+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-boilerplate-framework-tutorial\/"},"wordCount":3004,"commentCount":3,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-boilerplate-framework-tutorial\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg","keywords":["Boilerplate"],"articleSection":["HTML5"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/html5\/html5-boilerplate-framework-tutorial\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-boilerplate-framework-tutorial\/","url":"https:\/\/www.webcodegeeks.com\/html5\/html5-boilerplate-framework-tutorial\/","name":"HTML5 Boilerplate Framework Tutorial - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-boilerplate-framework-tutorial\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-boilerplate-framework-tutorial\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg","datePublished":"2015-08-25T07:35:49+00:00","dateModified":"2018-06-19T20:22:46+00:00","description":"Interested to learn more about HTML5 Boilerplate Framework? Then check out our Tutorial where we explain why is a very basic but powerful HTML framework!","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-boilerplate-framework-tutorial\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/html5\/html5-boilerplate-framework-tutorial\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-boilerplate-framework-tutorial\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-boilerplate-framework-tutorial\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"HTML5","item":"https:\/\/www.webcodegeeks.com\/category\/html5\/"},{"@type":"ListItem","position":3,"name":"HTML5 Boilerplate Framework Tutorial"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/1dfb88b4a8d08c37a6080311fd330a22","name":"Fabio Cimo","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b3df055f2e1b62e238889fafbb16121c68aab1adcd11af670e185cafae201b3b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b3df055f2e1b62e238889fafbb16121c68aab1adcd11af670e185cafae201b3b?s=96&d=mm&r=g","caption":"Fabio Cimo"},"description":"Fabio is a passionate student in web tehnologies including front-end (HTML\/CSS) and web design. He likes exploring as much as possible about the world wide web and how it can be more productive for us all. Currently he studies Computer Engineering, at the same time he works as a freelancer on both web programming and graphic design.","sameAs":["https:\/\/www.facebook.com\/fabiocimo","https:\/\/al.linkedin.com\/in\/fabiocimo","https:\/\/x.com\/fabiocimo","https:\/\/www.youtube.com\/fabiocimo1"],"url":"https:\/\/www.webcodegeeks.com\/author\/fabio-cimo\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/6322","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/75"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=6322"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/6322\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/914"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=6322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=6322"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=6322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}