HTML5 Boilerplate – Beginners Guide for Web Developers – 005

0
80

HTML5 Boilerplate – Beginners Guide for Web Developers

HTML5 Boilerplate.

This tutorial is connected from the previous HTML5 tutorial, the “HTML5 Shiv or Shim“.

In this tutorial, you will know what HTML5 Boilerplate intended to HTML5 and lets you create awesome HTML5 site without starting from scratch.

Click here to download the latest HTML5 boilerplate.

So, what HTML5 Boilerplate contains?

  • Google Analytics Snippet
  • Normalize.css
  • jQuery using Google CDN
  • Modernizr

These features of HTML5 Boilerplate can be explained on the HTML5 Boilerplate website provided on top of the features.

Now, let’s download the HTML5 Boilerplate and create a new folder named “boilerplate” from our recent HTML5 document, then extract it on the said folder.

So, let me explain to you about the contents inside the HTML5 Boilerplate.

Let us discuss about the humans.txt file:

  1. # humanstxt.org/
  2. # The humans responsible & technology colophon
  3.  
  4. # TEAM
  5.  
  6. <name> -- <role> -- <twitter>
  7.  
  8. # THANKS
  9.  
  10. <name>
  11.  
  12. # TECHNOLOGY COLOPHON
  13.  
  14. CSS3, HTML5
  15. Apache Server Configs, jQuery, Modernizr, Normalize.css

This is a great idea because you can know how you can give cross settings to robots.txt. humans.txt is for humans to look at it so that if you are on a site and you want to see a little bit more about the site to yourself.

You can self type and /humans.txt then you can get the THANKS, the TECHNOLOGY they are using, the TEAM and it is really a great idea. In fact, when you usually go to a site and you can see they are using humans.txt and you will know the guys are with it and it is really helpful and learn more about the project.

Next, let’s check out the index file located at your “boilerplate” folder:

 

  1. <!doctype html>
  2. <html class="no-js" lang="">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="x-ua-compatible" content="ie=edge">
  6. <title></title>
  7. <meta name="description" content="">
  8. <meta name="viewport" content="width=device-width, initial-scale=1">
  9.  
  10. <link rel="apple-touch-icon" href="apple-touch-icon.png">
  11. <!-- Place favicon.ico in the root directory -->
  12.  
  13. <link rel="stylesheet" href="css/normalize.css">
  14. <link rel="stylesheet" href="css/main.css">
  15. <a href="http://js/vendor/modernizr-2.8.3.min.js">http://js/vendor/modernizr-2.8.3.min.js</a>
  16. &lt;/head&gt;
  17. &lt;body&gt;
  18. &lt;!--[if lt IE 8]&gt;
  19. &lt;p class="browserupgrade"&gt;You are using an &lt;strong&gt;outdated&lt;/strong&gt; browser. Please &lt;a href="http://browsehappy.com/"&gt;upgrade your browser&lt;/a&gt; to improve your experience.&lt;/p&gt;
  20. &lt;![endif]--&gt;
  21.  
  22. &lt;!-- Add your site or application content here --&gt;
  23. &lt;p&gt;Hello world! This is HTML5 Boilerplate.&lt;/p&gt;
  24.  
  25. <a href="https://code.jquery.com/jquery-1.12.0.min.js">https://code.jquery.com/jquery-1.12.0.min.js</a>
  26. window.jQuery || document.write('')
  27. <a href="http://js/plugins.js">http://js/plugins.js</a>
  28. <a href="http://js/main.js">http://js/main.js</a>
  29.  
  30. &lt;!-- Google Analytics: change UA-XXXXX-X to be your site's ID. --&gt;
  31.  
  32. (function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
  33. function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
  34. e=o.createElement(i);r=o.getElementsByTagName(i)[0];
  35. e.src='https://www.google-analytics.com/analytics.js';
  36. r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
  37. ga('create','UA-XXXXX-X','auto');ga('send','pageview');
  38.  
  39. &lt;/body&gt;
  40. &lt;/html&gt;

As you can see the !DOCTYPE html is indicated there which this index file is an HTML5 document. The html file gives classes to our body based on what version of IE it is. Its basically giving us everything we need to start our project out.

Also, the default .css files are there, the normalize and main .css’ which have some basic styles for your HTML5 document. It also has some great print style stuff.

Basically, if you are on your old version of IE the html file is gonna give you a chromeframe notice that is going to allow you to install the chromeframe plug-in that lets your browser use modern features which is a great thing to you.

Then, you can see the google’s version of jQuery where their google is hosted and also a back-up of our own that is located on the boilerplate/js/vendor folder.

Also, there’s two default javascripts like the plugin.js and main.js.

So, later on if you want to put your plugins and your HTML5 document and jQueries and JavaScripts, you can put these on your blank plugin.js for plugins and main.js for jQueries and JavaScripts.

Also, on the last part of the HTML5 document, you can see a Google Analytics Script which can be helpful to where we can put our site’s ID.

It is not really a ton of stuff but it is really helpful in terms of creating your own HTML5 project without starting from scratch.

On our next tutorial, we will be discussing about Page Structure – Coding a Blogsite. Stay tuned webbies!

For questions or any other concerns or thesis/capstone creation with documentation, you can contact me through the following:

E-Mail: [email protected]

Facebook: facebook.com/kirk.lavapiez

Contact No.: +639771069640

Ian Hero L. Lavapiez

BSIT Graduate, soon to be MIT.

System Analyst and Developer

Related topic(s) that you may like:

 

 

Facebook Comments
(Visited 87 times, 1 visits today)

LEAVE A REPLY

Please enter your comment!
Please enter your name here