SlideShare une entreprise Scribd logo
1  sur  36
Easing Into
                   HTML5 and CSS3
                               Brian Moon
                              dealnews.com
Who attended the
HTML5 and Javascript
                              @brianlmoon
tutorial yesterday?    http://brian.moonspot.net/
What is in HTML5?
• New Semantic Tags
 • <article>, <header>, <footer>, etc.
• New Multimedia Tags
 • <canvas>, <video>, <audio>, etc.
• New Javascript APIs
• data- attributes
• HTML5 Forms
What is in CSS3?

• New Properties
• New Selectors
• Device dependent Media Queries
What is not
   HTML5 nor CSS3?

• SVG - been around, browsers just got
  better
• Geo-Location - Separate W3C spec from
  HTML5
Who uses your site?

• Are the tech savvy?
• Are they sensitive to change?
• Are they in China? (Lots of IE6 still)
• All Mobile?
dealnews browsers
IE6 0.30%
IE7 4.19%
IE8 11.91%
             22%
                                           IE9+
                                           FF3.5+
                                           Chrome
                                           Safari
                                     78%
                                           3.1+


                   Modern Browsers
                   Other
Our design goals

• Identical UI and UX on modern browsers
• Fully functional and usable on IE8, IE7 and
  Opera
• Page should render and users should be
  able to click things in IE6
First Step



All browsers process pages with
this doctype in standards mode.
http://blogs.msdn.com/b/jennifer/archive/2011/08/01/html5-part-1-semantic-markup-and-page-layout.aspx




<!DOCTYPE html>
<html>
<head>
    <title>Title</title>
                           Semantic Tags
</head>
<body>
    <header>
        <hgroup>
             <h1>Header in h1</h1>
             <h2>Subheader in h2</h2>
        </hgroup>
    </header>
    <nav>
        <ul>
             <li><a href="#">Menu Option 1</a></li>
             <li><a href="#">Menu Option 2</a></li>
             <li><a href="#">Menu Option 3</a></li>
        </ul>
    </nav>
    <section>
        <article>
             <header>
                 <h1>Article #1</h1>
             </header>
             <section>
                 This is the first article. This is <mark>highlighted</mark>.
             </section>
        </article>
        <article>
             <header>
                 <h1>Article #2</h1>
             </header>
             <section>
                 This is the second article. These articles could be blog posts, etc.
             </section>
        </article>
    </section>
Semantic Tags
• Older browsers don’t treat these as block
  elements
• CSS can fix it in some browsers
• Javascript (HTML Shiv) required in older IE
  versions
• Good semantic HTML4 markup and
  Microformats already recognized by scrapers
• Would use in new projects.YMMV on ROI for
  converting well done HTML
data attributes problem


• Unknown attributes are ignored by
  browsers, but the pages don’t validate.
• Hacks exist where classes are used
  (e.g. class=”artid-574244”)
data- attributes
<div class="art body" data-artid="574244">

   • Allows you to store data as an attribute
     that is ignored by the browser
   • Any attribute prefixed with data- is ignored
     by the browser (as all unknown attributes
     are) and are treated as valid HTML5.
   • Use element.getAttribute(“data-artid”); to
     get the data
   • Use it now. Works in all browsers.
Video & Audio
• Well documented licensing war
• Great idea, caught up in licensing issues
• May have to store your media in more than
  one format
• Javascript libraries exist to help with
  fallback
• Have used it via JS libs. Eases the pain. Falls
  back to Flash.
Canvas
• Graphics via markup/JS
• Not generally lighter weight than images, so
  not a replacement for static images
• Great for graphs and such
• Many, many javascript libraries to help build
  graphs via Canvas.
• Used for internal reporting where we
  dictate browser versions. Publicly,YMMV.
          Wanna waste time? http://canvasrider.com/
New JS APIs

• Web Performance - neat
• Local Storage - requires user prompt
• Web Workers (IE10)
• Web Sockets - very new, has issues
• You really need a good use case for these
HTML5 Forms
<input name=”email” type=”email”>

<input name=”url” type=”url”>

<input name=”name” type=”text” required>

<input name=”search” type=”text”
placeholder=”Search”>
HTML5 Forms
• Reduce custom validation Javascript
• You can query if a field is valid with
  checkValidity().
• Custom validation possible via event
  handlers
• Requires IE10 =(
• Some javascript libs can close the gap.
CSS3
Eye Candy
• border-radius (i.e. rounded corners)
• box-shadow
• gradient backgrounds
• multiple backgrounds
• transforms
• transitions
Use with fallback
• border-radius
• box-shadow
• gradient backgrounds
• multiple backgrounds
• Make sure the design holds up to your
  standard on browsers that don’t support
  these
Example

FF12




IE8
Example 2

 IE9   FF12




 IE7    IE8
Gnarly CSS
.cta {
    display: inline-block;
    vertical-align: bottom;
    -webkit-box-shadow: 1px 1px 2px 0px rgba(0,0,0,0.5);
    -moz-box-shadow:    1px 1px 2px 0px rgba(0,0,0,0.5);
    box-shadow:         1px 1px 2px 0px rgba(0,0,0,0.5);
    border-width: 0px;
    border-style: none;
    border-color: rgba(0,0,0,0);
    cursor: pointer;
    font-weight: bold;
    text-align: center;
    text-decoration: none;

    /* The is for the most commonly used design */
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 5px;
    padding: 0 12px;
    font: bold 12px arial,helvetica,clean,sans-serif;
    line-height: 20px;
    color: white;
    background: #6ecb12; /* Old browsers */
    background: -moz-linear-gradient(top, rgba(118,215,24,1) 19%, rgba(88,168,11,1) 100%); /* FF3.6+ */
    background: -webkit-gradient(linear, left top, left bottom, color-stop(19%,rgba(118,215,24,1)),
                                        color-stop(100%,rgba(88,168,11,1))); /* Chrome,Safari4+ */
    background: -webkit-linear-gradient(top, rgba(118,215,24,1) 19%,
                                        rgba(88,168,11,1) 100%); /* Chrome10+,Safari5.1+ */
    background: -o-linear-gradient(top, rgba(118,215,24,1) 19%,rgba(88,168,11,1) 100%); /* Opera11.10+ */
    background: -ms-linear-gradient(top, rgba(118,215,24,1) 19%,rgba(88,168,11,1) 100%); /* IE10+ */
    background: linear-gradient(top, rgba(118,215,24,1) 19%,rgba(88,168,11,1) 100%); /* W3C */
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#76d718',
                                      endColorstr='#58a80b',GradientType=0 ); /* IE6-9 */
}
CSS3 Tools

• http://css3generator.com/
• http://border-radius.com/
• http://www.colorzilla.com/gradient-editor/
Transitions
• Replaces javascript for some types of
  animations
• CSS language to define how an element
  changes from one state to another
• Should be treated as optional and have a fall
  back or the page should work without
  them
• Can be taxing on the browser
Transitions
#delay1 {  
  position: relative;  
  transition-property: font-size;  
  transition-duration: 4s;  
  transition-delay: 2s;  
  font-size: 14px;  
}  
  
#delay1:hover {  
  transition-property: font-size;  
  transition-duration: 4s;  
  transition-delay: 2s;  
  font-size: 36px;  
}  
Transforms
• CSS language for scaling and rotating
  elements
• Mixed with transistions, animation can be
  achieved.
• May require browser specific tweaking or
  even non-standard CSS for IE.
• Can confuse the box model and page flow
Example
          The labels are
          rotated 90
          degrees, but as
          you can see,
          Firebug things
          the element is in
          a different place
          than where it
          appears when
          drawn.
Transforms
.accordion .panel-label {
    -moz-transform-origin: 100% 0;
    -moz-transform: rotate(-90deg);
    -webkit-transform-origin: 100% 0;
    -webkit-transform: rotate(-90deg);
    -o-transform-origin: 100% 0;
    -o-transform: rotate(-90deg);
    transform-origin: 100% 0;
    transform: rotate(-90deg);
    position: absolute;
    top: 0;
    white-space:nowrap;
    text-align: right;

    /* MSIE < 10 */
    filter:
progid:DXImageTransform.Microsoft.BasicImage(rotation=3)9;
    left: 0px9;

}
Eye Candy Issues

• All of these techniques can be taxing on the
  browser and or device.
• Excessive use of gradients and transforms
  can cause major browser lag
• Many require browser prefixes (-moz or
  -webkit) or IE specific syntax (filter)
Selectors
tr:nth-child(2n+1)   /*   every odd row of an table */
tr:nth-child(odd)    /*   same */
tr:nth-child(2n+0)   /*   every even row of an table */
tr:nth-child(even)   /*   same */

tr:nth-last-child(-n+2) /* the two last rows of an table */

a:first-child /* a is first child of any element */

Also:
:first-of-type
:only-child
:only-of-type
:empty
          Browser performance may suffer using these
            on large, complex documents. Only use
           these when you can’t control the markup.
How Selectors Work
          This is not CSS3, but just general knowledge you need




• CSS is parsed and ALL rules are evaluated.
  More rules, more work for the browser
• Rules are evaluated right to left
• “.foo a” matches ALL a tags in the document
  and walks up the DOM to decide if they
  have a .foo parent.
Media Queries
@media all and (max-width: 699px) and (min-width: 520px),
               (min-width: 1151px) {
  body {
    background: #ccc;
  }
}


   • Allow you to specify different CSS for
      different device specifications
   • You can use these now to help with mobile
      design and usability. Those devices support
      it, older browsers ignore it.
Experiment
                     Firefox



                       IE6




http://brian.moonspot.net/experimenting-with-html5
Conclusion
• Understand your audience
• HTML5 Doctype works for HTML4, try it
• Use HTML5 semantic tags to fix bad HTML
  or on new projects
• Video is not the Flash killer we all hoped
  for. But, it does have its uses.
• HTML5 Forms have great potential, but still
  a nice to have for now.
Conclusion
• CSS3 eye candy is a great extra bit for
  users that can see it. Be sure you are happy
  with the fallback for others.
• New CSS3 selectors are powerful, but
  good markup with classes is still better
• CSS media queries are very helpful for
  formatting your pages on smaller screens
  and are supported on those platforms

Contenu connexe

Tendances

Continuous delivery with open source tools
Continuous delivery with open source toolsContinuous delivery with open source tools
Continuous delivery with open source toolsSebastian Helzle
 
Testing Your Code as Part of an Industrial Grade Workflow
Testing Your Code as Part of an Industrial Grade WorkflowTesting Your Code as Part of an Industrial Grade Workflow
Testing Your Code as Part of an Industrial Grade WorkflowPantheon
 
Continuous Delivery: The Dirty Details
Continuous Delivery: The Dirty DetailsContinuous Delivery: The Dirty Details
Continuous Delivery: The Dirty DetailsMike Brittain
 
Front-End Modernization for Mortals
Front-End Modernization for MortalsFront-End Modernization for Mortals
Front-End Modernization for Mortalscgack
 
JavaOne 2015 - Swimming upstream in the container revolution
JavaOne 2015 - Swimming upstream in the container revolutionJavaOne 2015 - Swimming upstream in the container revolution
JavaOne 2015 - Swimming upstream in the container revolutionBert Jan Schrijver
 
Drupal Performance
Drupal Performance Drupal Performance
Drupal Performance Pantheon
 
Web Performance & You - HighEdWeb Arkansas Version
Web Performance & You - HighEdWeb Arkansas VersionWeb Performance & You - HighEdWeb Arkansas Version
Web Performance & You - HighEdWeb Arkansas VersionDave Olsen
 
Continuous Deployment at Etsy: A Tale of Two Approaches
Continuous Deployment at Etsy: A Tale of Two ApproachesContinuous Deployment at Etsy: A Tale of Two Approaches
Continuous Deployment at Etsy: A Tale of Two ApproachesRoss Snyder
 
WTF: Where To Focus when you take over a Drupal project
WTF: Where To Focus when you take over a Drupal projectWTF: Where To Focus when you take over a Drupal project
WTF: Where To Focus when you take over a Drupal projectSymetris
 
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source Tools
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source ToolsTYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source Tools
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source ToolsMichael Lihs
 
How to survive continuous innovation - Sebastien Goasguen - DevOpsDays Tel Av...
How to survive continuous innovation - Sebastien Goasguen - DevOpsDays Tel Av...How to survive continuous innovation - Sebastien Goasguen - DevOpsDays Tel Av...
How to survive continuous innovation - Sebastien Goasguen - DevOpsDays Tel Av...DevOpsDays Tel Aviv
 
London Atlassian User Group - February 2014
London Atlassian User Group - February 2014London Atlassian User Group - February 2014
London Atlassian User Group - February 2014Steve Smith
 
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...Sonatype
 
Drupal 8 and Pantheon
Drupal 8 and PantheonDrupal 8 and Pantheon
Drupal 8 and PantheonPantheon
 
Using CI for continuous delivery Part 1
Using CI for continuous delivery Part 1Using CI for continuous delivery Part 1
Using CI for continuous delivery Part 1Vishal Biyani
 
Devops at Startup Weekend BXL
Devops at Startup Weekend BXLDevops at Startup Weekend BXL
Devops at Startup Weekend BXLKris Buytaert
 
Continuous deployment steve povilaitis
Continuous deployment   steve povilaitisContinuous deployment   steve povilaitis
Continuous deployment steve povilaitisSteve Povilaitis
 
DevOps - A Gentle Introduction
DevOps - A Gentle IntroductionDevOps - A Gentle Introduction
DevOps - A Gentle IntroductionGanesh Samarthyam
 
Continuous Integration using TFS
Continuous Integration using TFSContinuous Integration using TFS
Continuous Integration using TFSMohamed Samy
 

Tendances (20)

Continuous delivery with open source tools
Continuous delivery with open source toolsContinuous delivery with open source tools
Continuous delivery with open source tools
 
Testing Your Code as Part of an Industrial Grade Workflow
Testing Your Code as Part of an Industrial Grade WorkflowTesting Your Code as Part of an Industrial Grade Workflow
Testing Your Code as Part of an Industrial Grade Workflow
 
Continuous Delivery: The Dirty Details
Continuous Delivery: The Dirty DetailsContinuous Delivery: The Dirty Details
Continuous Delivery: The Dirty Details
 
Front-End Modernization for Mortals
Front-End Modernization for MortalsFront-End Modernization for Mortals
Front-End Modernization for Mortals
 
JavaOne 2015 - Swimming upstream in the container revolution
JavaOne 2015 - Swimming upstream in the container revolutionJavaOne 2015 - Swimming upstream in the container revolution
JavaOne 2015 - Swimming upstream in the container revolution
 
Drupal Performance
Drupal Performance Drupal Performance
Drupal Performance
 
Web Performance & You - HighEdWeb Arkansas Version
Web Performance & You - HighEdWeb Arkansas VersionWeb Performance & You - HighEdWeb Arkansas Version
Web Performance & You - HighEdWeb Arkansas Version
 
Continuous Deployment at Etsy: A Tale of Two Approaches
Continuous Deployment at Etsy: A Tale of Two ApproachesContinuous Deployment at Etsy: A Tale of Two Approaches
Continuous Deployment at Etsy: A Tale of Two Approaches
 
WTF: Where To Focus when you take over a Drupal project
WTF: Where To Focus when you take over a Drupal projectWTF: Where To Focus when you take over a Drupal project
WTF: Where To Focus when you take over a Drupal project
 
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source Tools
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source ToolsTYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source Tools
TYPO3 Camp Stuttgart 2015 - Continuous Delivery with Open Source Tools
 
How to survive continuous innovation - Sebastien Goasguen - DevOpsDays Tel Av...
How to survive continuous innovation - Sebastien Goasguen - DevOpsDays Tel Av...How to survive continuous innovation - Sebastien Goasguen - DevOpsDays Tel Av...
How to survive continuous innovation - Sebastien Goasguen - DevOpsDays Tel Av...
 
London Atlassian User Group - February 2014
London Atlassian User Group - February 2014London Atlassian User Group - February 2014
London Atlassian User Group - February 2014
 
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
 
Delivery Free of Charge
Delivery Free of ChargeDelivery Free of Charge
Delivery Free of Charge
 
Drupal 8 and Pantheon
Drupal 8 and PantheonDrupal 8 and Pantheon
Drupal 8 and Pantheon
 
Using CI for continuous delivery Part 1
Using CI for continuous delivery Part 1Using CI for continuous delivery Part 1
Using CI for continuous delivery Part 1
 
Devops at Startup Weekend BXL
Devops at Startup Weekend BXLDevops at Startup Weekend BXL
Devops at Startup Weekend BXL
 
Continuous deployment steve povilaitis
Continuous deployment   steve povilaitisContinuous deployment   steve povilaitis
Continuous deployment steve povilaitis
 
DevOps - A Gentle Introduction
DevOps - A Gentle IntroductionDevOps - A Gentle Introduction
DevOps - A Gentle Introduction
 
Continuous Integration using TFS
Continuous Integration using TFSContinuous Integration using TFS
Continuous Integration using TFS
 

En vedette

Gearmanpresentation 110308165409-phpapp01
Gearmanpresentation 110308165409-phpapp01Gearmanpresentation 110308165409-phpapp01
Gearmanpresentation 110308165409-phpapp01longtuan
 
Quick Introduction to Gearman
Quick Introduction to GearmanQuick Introduction to Gearman
Quick Introduction to GearmanGiuseppe Maxia
 
Gearmam, from the_worker's_perspective copy
Gearmam, from the_worker's_perspective copyGearmam, from the_worker's_perspective copy
Gearmam, from the_worker's_perspective copyBrian Aker
 
Kill bottlenecks with gearman, sphinx, and memcached, Confoo 2011
Kill bottlenecks with gearman, sphinx, and memcached, Confoo 2011Kill bottlenecks with gearman, sphinx, and memcached, Confoo 2011
Kill bottlenecks with gearman, sphinx, and memcached, Confoo 2011Bachkoutou Toutou
 
Website review
Website reviewWebsite review
Website reviewspg
 
Work Queues
Work QueuesWork Queues
Work Queuesciconf
 
Scale like a pro with Gearman
Scale like a pro with GearmanScale like a pro with Gearman
Scale like a pro with GearmanAmal Raghav
 
Gearman and asynchronous processing in PHP applications
Gearman and asynchronous processing in PHP applicationsGearman and asynchronous processing in PHP applications
Gearman and asynchronous processing in PHP applicationsTeamskunkworks
 

En vedette (8)

Gearmanpresentation 110308165409-phpapp01
Gearmanpresentation 110308165409-phpapp01Gearmanpresentation 110308165409-phpapp01
Gearmanpresentation 110308165409-phpapp01
 
Quick Introduction to Gearman
Quick Introduction to GearmanQuick Introduction to Gearman
Quick Introduction to Gearman
 
Gearmam, from the_worker's_perspective copy
Gearmam, from the_worker's_perspective copyGearmam, from the_worker's_perspective copy
Gearmam, from the_worker's_perspective copy
 
Kill bottlenecks with gearman, sphinx, and memcached, Confoo 2011
Kill bottlenecks with gearman, sphinx, and memcached, Confoo 2011Kill bottlenecks with gearman, sphinx, and memcached, Confoo 2011
Kill bottlenecks with gearman, sphinx, and memcached, Confoo 2011
 
Website review
Website reviewWebsite review
Website review
 
Work Queues
Work QueuesWork Queues
Work Queues
 
Scale like a pro with Gearman
Scale like a pro with GearmanScale like a pro with Gearman
Scale like a pro with Gearman
 
Gearman and asynchronous processing in PHP applications
Gearman and asynchronous processing in PHP applicationsGearman and asynchronous processing in PHP applications
Gearman and asynchronous processing in PHP applications
 

Similaire à Ease into HTML5 and CSS3

Modern Web Development
Modern Web DevelopmentModern Web Development
Modern Web DevelopmentRobert Nyman
 
HTML5 History & Features
HTML5 History & FeaturesHTML5 History & Features
HTML5 History & FeaturesDave Ross
 
html5 an introduction
html5 an introductionhtml5 an introduction
html5 an introductionvrt-medialab
 
HTML5: An Introduction To Next Generation Web Development
HTML5: An Introduction To Next Generation Web DevelopmentHTML5: An Introduction To Next Generation Web Development
HTML5: An Introduction To Next Generation Web DevelopmentTilak Joshi
 
HTML5, just another presentation :)
HTML5, just another presentation :)HTML5, just another presentation :)
HTML5, just another presentation :)François Massart
 
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5Sadaaki HIRAI
 
It's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking ModernizrIt's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking ModernizrMichael Enslow
 
Highly Maintainable, Efficient, and Optimized CSS
Highly Maintainable, Efficient, and Optimized CSSHighly Maintainable, Efficient, and Optimized CSS
Highly Maintainable, Efficient, and Optimized CSSZoe Gillenwater
 
HTML5: An Overview
HTML5: An OverviewHTML5: An Overview
HTML5: An OverviewNagendra Um
 
About Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JSAbout Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JSNaga Harish M
 
C# Advanced L09-HTML5+ASP
C# Advanced L09-HTML5+ASPC# Advanced L09-HTML5+ASP
C# Advanced L09-HTML5+ASPMohammad Shaker
 
Adobe MAX 2008: HTML/CSS + Fireworks
Adobe MAX 2008: HTML/CSS + FireworksAdobe MAX 2008: HTML/CSS + Fireworks
Adobe MAX 2008: HTML/CSS + FireworksNathan Smith
 
Developing web applications in 2010
Developing web applications in 2010Developing web applications in 2010
Developing web applications in 2010Ignacio Coloma
 

Similaire à Ease into HTML5 and CSS3 (20)

Modern Web Development
Modern Web DevelopmentModern Web Development
Modern Web Development
 
HTML5 History & Features
HTML5 History & FeaturesHTML5 History & Features
HTML5 History & Features
 
html5 an introduction
html5 an introductionhtml5 an introduction
html5 an introduction
 
Html5 more than just html5 v final
Html5  more than just html5 v finalHtml5  more than just html5 v final
Html5 more than just html5 v final
 
HTML5: An Introduction To Next Generation Web Development
HTML5: An Introduction To Next Generation Web DevelopmentHTML5: An Introduction To Next Generation Web Development
HTML5: An Introduction To Next Generation Web Development
 
Echo HTML5
Echo HTML5Echo HTML5
Echo HTML5
 
HTML5, just another presentation :)
HTML5, just another presentation :)HTML5, just another presentation :)
HTML5, just another presentation :)
 
Demystifying HTML5
Demystifying HTML5Demystifying HTML5
Demystifying HTML5
 
Html forfood
Html forfoodHtml forfood
Html forfood
 
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
 
It's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking ModernizrIt's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking Modernizr
 
Highly Maintainable, Efficient, and Optimized CSS
Highly Maintainable, Efficient, and Optimized CSSHighly Maintainable, Efficient, and Optimized CSS
Highly Maintainable, Efficient, and Optimized CSS
 
HTML5 and Joomla! 2.5 Template
HTML5 and Joomla! 2.5 TemplateHTML5 and Joomla! 2.5 Template
HTML5 and Joomla! 2.5 Template
 
HTML5: An Overview
HTML5: An OverviewHTML5: An Overview
HTML5: An Overview
 
About Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JSAbout Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JS
 
Html5 public
Html5 publicHtml5 public
Html5 public
 
C# Advanced L09-HTML5+ASP
C# Advanced L09-HTML5+ASPC# Advanced L09-HTML5+ASP
C# Advanced L09-HTML5+ASP
 
Adobe MAX 2008: HTML/CSS + Fireworks
Adobe MAX 2008: HTML/CSS + FireworksAdobe MAX 2008: HTML/CSS + Fireworks
Adobe MAX 2008: HTML/CSS + Fireworks
 
Developing web applications in 2010
Developing web applications in 2010Developing web applications in 2010
Developing web applications in 2010
 
Html5
Html5Html5
Html5
 

Dernier

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 

Dernier (20)

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 

Ease into HTML5 and CSS3

  • 1. Easing Into HTML5 and CSS3 Brian Moon dealnews.com Who attended the HTML5 and Javascript @brianlmoon tutorial yesterday? http://brian.moonspot.net/
  • 2. What is in HTML5? • New Semantic Tags • <article>, <header>, <footer>, etc. • New Multimedia Tags • <canvas>, <video>, <audio>, etc. • New Javascript APIs • data- attributes • HTML5 Forms
  • 3. What is in CSS3? • New Properties • New Selectors • Device dependent Media Queries
  • 4. What is not HTML5 nor CSS3? • SVG - been around, browsers just got better • Geo-Location - Separate W3C spec from HTML5
  • 5. Who uses your site? • Are the tech savvy? • Are they sensitive to change? • Are they in China? (Lots of IE6 still) • All Mobile?
  • 6. dealnews browsers IE6 0.30% IE7 4.19% IE8 11.91% 22% IE9+ FF3.5+ Chrome Safari 78% 3.1+ Modern Browsers Other
  • 7. Our design goals • Identical UI and UX on modern browsers • Fully functional and usable on IE8, IE7 and Opera • Page should render and users should be able to click things in IE6
  • 8. First Step All browsers process pages with this doctype in standards mode.
  • 9. http://blogs.msdn.com/b/jennifer/archive/2011/08/01/html5-part-1-semantic-markup-and-page-layout.aspx <!DOCTYPE html> <html> <head> <title>Title</title> Semantic Tags </head> <body> <header> <hgroup> <h1>Header in h1</h1> <h2>Subheader in h2</h2> </hgroup> </header> <nav> <ul> <li><a href="#">Menu Option 1</a></li> <li><a href="#">Menu Option 2</a></li> <li><a href="#">Menu Option 3</a></li> </ul> </nav> <section> <article> <header> <h1>Article #1</h1> </header> <section> This is the first article. This is <mark>highlighted</mark>. </section> </article> <article> <header> <h1>Article #2</h1> </header> <section> This is the second article. These articles could be blog posts, etc. </section> </article> </section>
  • 10. Semantic Tags • Older browsers don’t treat these as block elements • CSS can fix it in some browsers • Javascript (HTML Shiv) required in older IE versions • Good semantic HTML4 markup and Microformats already recognized by scrapers • Would use in new projects.YMMV on ROI for converting well done HTML
  • 11. data attributes problem • Unknown attributes are ignored by browsers, but the pages don’t validate. • Hacks exist where classes are used (e.g. class=”artid-574244”)
  • 12. data- attributes <div class="art body" data-artid="574244"> • Allows you to store data as an attribute that is ignored by the browser • Any attribute prefixed with data- is ignored by the browser (as all unknown attributes are) and are treated as valid HTML5. • Use element.getAttribute(“data-artid”); to get the data • Use it now. Works in all browsers.
  • 13. Video & Audio • Well documented licensing war • Great idea, caught up in licensing issues • May have to store your media in more than one format • Javascript libraries exist to help with fallback • Have used it via JS libs. Eases the pain. Falls back to Flash.
  • 14. Canvas • Graphics via markup/JS • Not generally lighter weight than images, so not a replacement for static images • Great for graphs and such • Many, many javascript libraries to help build graphs via Canvas. • Used for internal reporting where we dictate browser versions. Publicly,YMMV. Wanna waste time? http://canvasrider.com/
  • 15. New JS APIs • Web Performance - neat • Local Storage - requires user prompt • Web Workers (IE10) • Web Sockets - very new, has issues • You really need a good use case for these
  • 16. HTML5 Forms <input name=”email” type=”email”> <input name=”url” type=”url”> <input name=”name” type=”text” required> <input name=”search” type=”text” placeholder=”Search”>
  • 17. HTML5 Forms • Reduce custom validation Javascript • You can query if a field is valid with checkValidity(). • Custom validation possible via event handlers • Requires IE10 =( • Some javascript libs can close the gap.
  • 18. CSS3
  • 19. Eye Candy • border-radius (i.e. rounded corners) • box-shadow • gradient backgrounds • multiple backgrounds • transforms • transitions
  • 20. Use with fallback • border-radius • box-shadow • gradient backgrounds • multiple backgrounds • Make sure the design holds up to your standard on browsers that don’t support these
  • 22. Example 2 IE9 FF12 IE7 IE8
  • 23. Gnarly CSS .cta { display: inline-block; vertical-align: bottom; -webkit-box-shadow: 1px 1px 2px 0px rgba(0,0,0,0.5); -moz-box-shadow: 1px 1px 2px 0px rgba(0,0,0,0.5); box-shadow: 1px 1px 2px 0px rgba(0,0,0,0.5); border-width: 0px; border-style: none; border-color: rgba(0,0,0,0); cursor: pointer; font-weight: bold; text-align: center; text-decoration: none; /* The is for the most commonly used design */ -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; padding: 0 12px; font: bold 12px arial,helvetica,clean,sans-serif; line-height: 20px; color: white; background: #6ecb12; /* Old browsers */ background: -moz-linear-gradient(top, rgba(118,215,24,1) 19%, rgba(88,168,11,1) 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(19%,rgba(118,215,24,1)), color-stop(100%,rgba(88,168,11,1))); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, rgba(118,215,24,1) 19%, rgba(88,168,11,1) 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, rgba(118,215,24,1) 19%,rgba(88,168,11,1) 100%); /* Opera11.10+ */ background: -ms-linear-gradient(top, rgba(118,215,24,1) 19%,rgba(88,168,11,1) 100%); /* IE10+ */ background: linear-gradient(top, rgba(118,215,24,1) 19%,rgba(88,168,11,1) 100%); /* W3C */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#76d718', endColorstr='#58a80b',GradientType=0 ); /* IE6-9 */ }
  • 24. CSS3 Tools • http://css3generator.com/ • http://border-radius.com/ • http://www.colorzilla.com/gradient-editor/
  • 25. Transitions • Replaces javascript for some types of animations • CSS language to define how an element changes from one state to another • Should be treated as optional and have a fall back or the page should work without them • Can be taxing on the browser
  • 27. Transforms • CSS language for scaling and rotating elements • Mixed with transistions, animation can be achieved. • May require browser specific tweaking or even non-standard CSS for IE. • Can confuse the box model and page flow
  • 28. Example The labels are rotated 90 degrees, but as you can see, Firebug things the element is in a different place than where it appears when drawn.
  • 29. Transforms .accordion .panel-label { -moz-transform-origin: 100% 0; -moz-transform: rotate(-90deg); -webkit-transform-origin: 100% 0; -webkit-transform: rotate(-90deg); -o-transform-origin: 100% 0; -o-transform: rotate(-90deg); transform-origin: 100% 0; transform: rotate(-90deg); position: absolute; top: 0; white-space:nowrap; text-align: right; /* MSIE < 10 */ filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3)9; left: 0px9; }
  • 30. Eye Candy Issues • All of these techniques can be taxing on the browser and or device. • Excessive use of gradients and transforms can cause major browser lag • Many require browser prefixes (-moz or -webkit) or IE specific syntax (filter)
  • 31. Selectors tr:nth-child(2n+1) /* every odd row of an table */ tr:nth-child(odd) /* same */ tr:nth-child(2n+0) /* every even row of an table */ tr:nth-child(even) /* same */ tr:nth-last-child(-n+2) /* the two last rows of an table */ a:first-child /* a is first child of any element */ Also: :first-of-type :only-child :only-of-type :empty Browser performance may suffer using these on large, complex documents. Only use these when you can’t control the markup.
  • 32. How Selectors Work This is not CSS3, but just general knowledge you need • CSS is parsed and ALL rules are evaluated. More rules, more work for the browser • Rules are evaluated right to left • “.foo a” matches ALL a tags in the document and walks up the DOM to decide if they have a .foo parent.
  • 33. Media Queries @media all and (max-width: 699px) and (min-width: 520px), (min-width: 1151px) { body { background: #ccc; } } • Allow you to specify different CSS for different device specifications • You can use these now to help with mobile design and usability. Those devices support it, older browsers ignore it.
  • 34. Experiment Firefox IE6 http://brian.moonspot.net/experimenting-with-html5
  • 35. Conclusion • Understand your audience • HTML5 Doctype works for HTML4, try it • Use HTML5 semantic tags to fix bad HTML or on new projects • Video is not the Flash killer we all hoped for. But, it does have its uses. • HTML5 Forms have great potential, but still a nice to have for now.
  • 36. Conclusion • CSS3 eye candy is a great extra bit for users that can see it. Be sure you are happy with the fallback for others. • New CSS3 selectors are powerful, but good markup with classes is still better • CSS media queries are very helpful for formatting your pages on smaller screens and are supported on those platforms

Notes de l'éditeur

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n