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

What's hot (20)

PDF
API Technical Writing
Sarah Maddox
 
PDF
BDD - Writing better scenario
Arnauld Loyer
 
PPTX
HTML/HTML5
People Strategists
 
PPTX
SharePoint 2010 Web Standards & Accessibility
Mavention
 
KEY
An Introduction to HTML5
Steven Chipman
 
PDF
Building mobile applications with DrupalGap
Alex S
 
ODP
Ant User Guide
Muthuselvam RS
 
PDF
EuroPython 2011 - How to build complex web applications having fun?
Andrew Mleczko
 
PDF
What the heck is HTML 5?
Simon Willison
 
PPT
Lecture 3 Javascript1
Sur College of Applied Sciences
 
PDF
HTML5--The 30,000' View (A fast-paced overview of HTML5)
Peter Lubbers
 
PPTX
Introduction to html 5
Sayed Ahmed
 
PDF
HTML5: features with examples
Alfredo Torre
 
PDF
Basics of css and xhtml
sagaroceanic11
 
PPT
Introdution to HTML 5
onkar_bhosle
 
PPTX
Html 5 Features And Benefits
Software Engineering
 
PDF
Introduction to HTML5
Gil Fink
 
PPTX
What is HTML 5?
Susan Winters
 
PDF
Html 5 New Features
Ata Ebrahimi
 
PPT
Introduction to HTML5
IT Geeks
 
API Technical Writing
Sarah Maddox
 
BDD - Writing better scenario
Arnauld Loyer
 
HTML/HTML5
People Strategists
 
SharePoint 2010 Web Standards & Accessibility
Mavention
 
An Introduction to HTML5
Steven Chipman
 
Building mobile applications with DrupalGap
Alex S
 
Ant User Guide
Muthuselvam RS
 
EuroPython 2011 - How to build complex web applications having fun?
Andrew Mleczko
 
What the heck is HTML 5?
Simon Willison
 
Lecture 3 Javascript1
Sur College of Applied Sciences
 
HTML5--The 30,000' View (A fast-paced overview of HTML5)
Peter Lubbers
 
Introduction to html 5
Sayed Ahmed
 
HTML5: features with examples
Alfredo Torre
 
Basics of css and xhtml
sagaroceanic11
 
Introdution to HTML 5
onkar_bhosle
 
Html 5 Features And Benefits
Software Engineering
 
Introduction to HTML5
Gil Fink
 
What is HTML 5?
Susan Winters
 
Html 5 New Features
Ata Ebrahimi
 
Introduction to HTML5
IT Geeks
 

Similar to Intro to html5 Boilerplate (20)

PDF
Developing Your Ultimate Package
Simon Collison
 
PPTX
Best Practices for Building WordPress Applications
Taylor Lovett
 
PDF
[In Control 2010] HTML5
Christopher Schmitt
 
KEY
It's a Mod World - A Practical Guide to Rocking Modernizr
Michael Enslow
 
PDF
Building the next generation of themes with WP Rig 2.0
Morten Rand-Hendriksen
 
PDF
Keep Your Code Organized! WordCamp Montreal 2013 Presentation slides
Jer Clarke
 
PPT
Web development today
Jaydev Gajera
 
PPT
HTML5 ★ Boilerplate
Mohammed Arif
 
PPTX
Untangling spring week5
Derek Jacoby
 
PPTX
Untying the Knots of Web Dev with Internet Explorer
Sarah Dutkiewicz
 
PDF
presentation
tutorialsruby
 
PDF
Add-On Development: EE Expects that Every Developer will do his Duty
reedmaniac
 
PPT
Know the reason behind choosing bootstrap as css framework
Omkarsoft Bangalore
 
PPTX
Popping the Hood: How to Create Custom SharePoint Branding by Randy Drisgill ...
SPTechCon
 
PDF
Node.js 101
FITC
 
PDF
Using Cool New Frameworks in (Mobile) Domino Apps
Teamstudio
 
PDF
HTML5 Design
Christopher Schmitt
 
PPTX
Untangling the web - fall2017 - class 4
Derek Jacoby
 
PDF
WordCamp Sheffield 2014 Theme Workflow Presentation
Jonny Allbut
 
PDF
Best Practices for WordPress
Taylor Lovett
 
Developing Your Ultimate Package
Simon Collison
 
Best Practices for Building WordPress Applications
Taylor Lovett
 
[In Control 2010] HTML5
Christopher Schmitt
 
It's a Mod World - A Practical Guide to Rocking Modernizr
Michael Enslow
 
Building the next generation of themes with WP Rig 2.0
Morten Rand-Hendriksen
 
Keep Your Code Organized! WordCamp Montreal 2013 Presentation slides
Jer Clarke
 
Web development today
Jaydev Gajera
 
HTML5 ★ Boilerplate
Mohammed Arif
 
Untangling spring week5
Derek Jacoby
 
Untying the Knots of Web Dev with Internet Explorer
Sarah Dutkiewicz
 
presentation
tutorialsruby
 
Add-On Development: EE Expects that Every Developer will do his Duty
reedmaniac
 
Know the reason behind choosing bootstrap as css framework
Omkarsoft Bangalore
 
Popping the Hood: How to Create Custom SharePoint Branding by Randy Drisgill ...
SPTechCon
 
Node.js 101
FITC
 
Using Cool New Frameworks in (Mobile) Domino Apps
Teamstudio
 
HTML5 Design
Christopher Schmitt
 
Untangling the web - fall2017 - class 4
Derek Jacoby
 
WordCamp Sheffield 2014 Theme Workflow Presentation
Jonny Allbut
 
Best Practices for WordPress
Taylor Lovett
 
Ad

Recently uploaded (20)

PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PPT
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Ad

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