SlideShare a Scribd company logo
INTRO TO

HTML5 BOILERPLATE
RESPECT!

Paul Irish
Google Chrome, jQuery
http://paulirish.com

Divya Manian
Nimbupani Designs
http://nimbupani.com

And a bunch of other cool kids listed at http://html5boilerplate.com
WHAT IS IT?

 “HTML5 Boilerplate is the professional badass's
base HTML/CSS/JS template for a fast, robust and
  future-proof site.” ~from htmlboilerplate.com

It helps you to quickly get up and running
        with front-end web projects.
HOW?

It features:
• HTML5
• Code you can reuse
• Browser compatibility
• JavaScript and CSS optimization
• Progressive enhancement hooks
WHERE DO I GET IT?

• http://html5boilerplate.com
• Or bleeding edge:
  https://github.com/paulirish/html5-
  boilerplate
TWO VERSIONS

One Documented. One stripped.
• Use the documented version learn.
• Use the stripped version in your projects.
FEATURES
TOP LEVEL
ICONS


• favicon.ico for browsers
• apple-touch-icon.png for iPhone, iPad
 and Android
WEB SERVER CONFIGS

• Apache: .htacces
• nginx: nginx.conf
• IIS: web.config
FEATURES
THE MARKUP
SIMPLE DOCTYPE
  <!doctype html>

       burp.
NO MORE CONDITIONAL STYLE SHEETS AND
        ORPHANED CSS HACKS

Use conditional comments to add “ie” classes:
<!--[if   lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if   IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if   IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if   IE 9 ]>    <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if   (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->

Allows you to do this in your CSS:

div.foo { padding-right: 10px; }

.ie6 div.foo { padding-right: 5px; }
X-UA-COMPATIBLE


Includes X-UA-Compatible meta declaration:
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">


• Forces IE 8 & 9 to use latest rendering engine
VIEWPORT
Includes meta viewport declaration:
<meta name="viewport" content="width=device-width, initial-
scale=1.0">


•   Sets the viewport display on devices to width of display instead
    of default 980px

•   Sets the initial scale to 1.0, because... why not?

     If you’re not using a mobile style sheet might consider using default viewport settings.
INCLUDES MODERNIZR
“Modernizr adds classes to the <html> element which allow you to target specific
browser functionality in your stylesheet.”
~from modernizr.com

Add this script:
<script src="js/libs/modernizr-1.6.min.js"></script>


Do “if” statements in your CSS:
.multiplebgs div p {
  /* properties for browsers that support multiple backgrounds */
}
.no-multiplebgs div p {
  /* optional fallback properties for browsers that don't */
}
MODERNIZR ALSO...

Allows you to do JavaScript enabled “if” statements in
your CSS.

•   If modernizr loads, “no-js” is replaced with “js”

•   Before: <html   lang="en" class="no-js ... >


•   After: <html   lang="en" class="js ... >
DEMO FOLDER

• Comprehensive collection of HTML5
  elements
• Example of how you should set up your head
  and script files
• Google Analytics
          Don’t leave it in your production code
STYLES
• Reset
• Font normalization
• Base Styles
• Primary Site Styles (Your masterpiece)
• Media Queries
• Print Style
ADVANCED FEATURES


• JavaScript Profiling
• Build script
PITFALLS
NOT A FRAMEWORK
Bring what you need to your project.
TABS OR SOFT TABS.
                   NOT BOTH!



• HTML5 Boilerplate uses Soft Tabs
• Find out the best practices for the
  framework you’re working with and adjust
           A kitten dies each time you mix tabs and soft tabs.
DON’T ADD EVERYTHING
          TO YOUR PROJECTS

• Don’t need add all configs
• Don’t need JavaScript Profiler
• Don’t need to include Demo directory
• If you don’t know how to use build don’t
  leave it in your project
READ MORE
•   http://html5boilerplate.com

•   Github Repo:
    https://github.com/paulirish/html5-boilerplate

•   Conditional stylesheets vs CSS hacks? Answer:
    Neither!
    http://paulirish.com/2008/conditional-stylesheets-
    vs-css-hacks-answer-neither

•   Modernizr
    http://www.modernizr.com
YOURS TRULY
Michael Enslow

Principal Developer and
Co-founder of Mister
Machine

http://mistermachine.com

Follow me: @menslow

More Related Content

ZIP
Looking into HTML5
PDF
Html 5 in a big nutshell
PPTX
Css, xhtml, javascript
PDF
HTML5 & Friends
PDF
The Future of the Web: HTML5
PDF
HTML5 for PHP Developers - IPC
PPTX
Html 5 tutorial - By Bally Chohan
PPT
HTML 5 Overview
Looking into HTML5
Html 5 in a big nutshell
Css, xhtml, javascript
HTML5 & Friends
The Future of the Web: HTML5
HTML5 for PHP Developers - IPC
Html 5 tutorial - By Bally Chohan
HTML 5 Overview

What's hot (20)

PDF
API Technical Writing
PDF
BDD - Writing better scenario
PPTX
HTML/HTML5
PPTX
SharePoint 2010 Web Standards & Accessibility
KEY
An Introduction to HTML5
PDF
Building mobile applications with DrupalGap
ODP
Ant User Guide
PDF
EuroPython 2011 - How to build complex web applications having fun?
PDF
What the heck is HTML 5?
PPT
Lecture 3 Javascript1
PDF
HTML5--The 30,000' View (A fast-paced overview of HTML5)
PPTX
Introduction to html 5
PDF
HTML5: features with examples
PDF
Basics of css and xhtml
PPT
Introdution to HTML 5
PPTX
Html 5 Features And Benefits
PDF
Introduction to HTML5
PPTX
What is HTML 5?
PDF
Html 5 New Features
PPT
Introduction to HTML5
API Technical Writing
BDD - Writing better scenario
HTML/HTML5
SharePoint 2010 Web Standards & Accessibility
An Introduction to HTML5
Building mobile applications with DrupalGap
Ant User Guide
EuroPython 2011 - How to build complex web applications having fun?
What the heck is HTML 5?
Lecture 3 Javascript1
HTML5--The 30,000' View (A fast-paced overview of HTML5)
Introduction to html 5
HTML5: features with examples
Basics of css and xhtml
Introdution to HTML 5
Html 5 Features And Benefits
Introduction to HTML5
What is HTML 5?
Html 5 New Features
Introduction to HTML5
Ad

Similar to Intro to html5 Boilerplate (20)

PPT
Web development today
PPTX
Html5 & less css
PPT
HTML5 ★ Boilerplate
PDF
KEY
HTML5: It goes to ELEVEN
DOCX
gbar.jpgglogo.jpgmaa.jpgmaah5txt.css New Pe.docx
ZIP
Html5 public
PDF
Developing web applications in 2010
DOCX
New Perspectives on HTML Tutorial 1 Review Assig.docx
PDF
Sitepoint.com a basic-html5_template
KEY
Ease into HTML5 and CSS3
PPTX
Html5 with SharePoint 2010
PDF
Prototyping w/HTML5 and CSS3
KEY
It's a Mod World - A Practical Guide to Rocking Modernizr
PPTX
HTML5 and CSS3 Techniques You Can Use Today
KEY
Angels versus demons: balancing shiny and inclusive
PPTX
Web technologies part-2
PPT
Html5 basics
DOCX
modernizr-1.5.js! Modernizr JavaScript library 1.5 .docx
KEY
The web standards gentleman: a matter of (evolving) standards)
Web development today
Html5 & less css
HTML5 ★ Boilerplate
HTML5: It goes to ELEVEN
gbar.jpgglogo.jpgmaa.jpgmaah5txt.css New Pe.docx
Html5 public
Developing web applications in 2010
New Perspectives on HTML Tutorial 1 Review Assig.docx
Sitepoint.com a basic-html5_template
Ease into HTML5 and CSS3
Html5 with SharePoint 2010
Prototyping w/HTML5 and CSS3
It's a Mod World - A Practical Guide to Rocking Modernizr
HTML5 and CSS3 Techniques You Can Use Today
Angels versus demons: balancing shiny and inclusive
Web technologies part-2
Html5 basics
modernizr-1.5.js! Modernizr JavaScript library 1.5 .docx
The web standards gentleman: a matter of (evolving) standards)
Ad

Recently uploaded (20)

PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
cuic standard and advanced reporting.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
A Presentation on Artificial Intelligence
PPTX
Cloud computing and distributed systems.
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
NewMind AI Monthly Chronicles - July 2025
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Modernizing your data center with Dell and AMD
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
KodekX | Application Modernization Development
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
NewMind AI Weekly Chronicles - August'25 Week I
cuic standard and advanced reporting.pdf
Understanding_Digital_Forensics_Presentation.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
A Presentation on Artificial Intelligence
Cloud computing and distributed systems.
Advanced methodologies resolving dimensionality complications for autism neur...
20250228 LYD VKU AI Blended-Learning.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Review of recent advances in non-invasive hemoglobin estimation
NewMind AI Monthly Chronicles - July 2025
“AI and Expert System Decision Support & Business Intelligence Systems”
Modernizing your data center with Dell and AMD
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
KodekX | Application Modernization Development
Digital-Transformation-Roadmap-for-Companies.pptx
Per capita expenditure prediction using model stacking based on satellite ima...

Intro to html5 Boilerplate

  • 2. RESPECT! Paul Irish Google Chrome, jQuery http://paulirish.com Divya Manian Nimbupani Designs http://nimbupani.com And a bunch of other cool kids listed at http://html5boilerplate.com
  • 3. WHAT IS IT? “HTML5 Boilerplate is the professional badass's base HTML/CSS/JS template for a fast, robust and future-proof site.” ~from htmlboilerplate.com It helps you to quickly get up and running with front-end web projects.
  • 4. HOW? It features: • HTML5 • Code you can reuse • Browser compatibility • JavaScript and CSS optimization • Progressive enhancement hooks
  • 5. WHERE DO I GET IT? • http://html5boilerplate.com • Or bleeding edge: https://github.com/paulirish/html5- boilerplate
  • 6. TWO VERSIONS One Documented. One stripped. • Use the documented version learn. • Use the stripped version in your projects.
  • 8. ICONS • favicon.ico for browsers • apple-touch-icon.png for iPhone, iPad and Android
  • 9. WEB SERVER CONFIGS • Apache: .htacces • nginx: nginx.conf • IIS: web.config
  • 11. SIMPLE DOCTYPE <!doctype html> burp.
  • 12. NO MORE CONDITIONAL STYLE SHEETS AND ORPHANED CSS HACKS Use conditional comments to add “ie” classes: <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]--> <!--[if IE 7 ]> <html lang="en" class="no-js ie7"> <![endif]--> <!--[if IE 8 ]> <html lang="en" class="no-js ie8"> <![endif]--> <!--[if IE 9 ]> <html lang="en" class="no-js ie9"> <![endif]--> <!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]--> Allows you to do this in your CSS: div.foo { padding-right: 10px; } .ie6 div.foo { padding-right: 5px; }
  • 13. X-UA-COMPATIBLE Includes X-UA-Compatible meta declaration: <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> • Forces IE 8 & 9 to use latest rendering engine
  • 14. VIEWPORT Includes meta viewport declaration: <meta name="viewport" content="width=device-width, initial- scale=1.0"> • Sets the viewport display on devices to width of display instead of default 980px • Sets the initial scale to 1.0, because... why not? If you’re not using a mobile style sheet might consider using default viewport settings.
  • 15. INCLUDES MODERNIZR “Modernizr adds classes to the <html> element which allow you to target specific browser functionality in your stylesheet.” ~from modernizr.com Add this script: <script src="js/libs/modernizr-1.6.min.js"></script> Do “if” statements in your CSS: .multiplebgs div p { /* properties for browsers that support multiple backgrounds */ } .no-multiplebgs div p { /* optional fallback properties for browsers that don't */ }
  • 16. MODERNIZR ALSO... Allows you to do JavaScript enabled “if” statements in your CSS. • If modernizr loads, “no-js” is replaced with “js” • Before: <html lang="en" class="no-js ... > • After: <html lang="en" class="js ... >
  • 17. DEMO FOLDER • Comprehensive collection of HTML5 elements • Example of how you should set up your head and script files • Google Analytics Don’t leave it in your production code
  • 18. STYLES • Reset • Font normalization • Base Styles • Primary Site Styles (Your masterpiece) • Media Queries • Print Style
  • 19. ADVANCED FEATURES • JavaScript Profiling • Build script
  • 21. NOT A FRAMEWORK Bring what you need to your project.
  • 22. TABS OR SOFT TABS. NOT BOTH! • HTML5 Boilerplate uses Soft Tabs • Find out the best practices for the framework you’re working with and adjust A kitten dies each time you mix tabs and soft tabs.
  • 23. DON’T ADD EVERYTHING TO YOUR PROJECTS • Don’t need add all configs • Don’t need JavaScript Profiler • Don’t need to include Demo directory • If you don’t know how to use build don’t leave it in your project
  • 24. READ MORE • http://html5boilerplate.com • Github Repo: https://github.com/paulirish/html5-boilerplate • Conditional stylesheets vs CSS hacks? Answer: Neither! http://paulirish.com/2008/conditional-stylesheets- vs-css-hacks-answer-neither • Modernizr http://www.modernizr.com
  • 25. YOURS TRULY Michael Enslow Principal Developer and Co-founder of Mister Machine http://mistermachine.com Follow me: @menslow