SlideShare ist ein Scribd-Unternehmen logo
1 von 30
Downloaden Sie, um offline zu lesen
Progressive Enhancement

Bridging the gap between CSS2 and CSS3



              Zohar Arad, April 2010

  zohar@zohararad.com | http://www.zohararad.com
Agenda

Current situation - Problems with implementing
cross-platform web-designs

Progressive Enhancement - Solving cross-platform
design implementation

CSS3 - Common desired features

Bridging the gap between CSS2 and CSS3
Current Situation
Current Situation

There are at least 4 major rendering engines out there:
Trident, WebKit, Gecko, Presto

Browser version releases and adoption are slow
Two camps situation - IE vs. the rest
CSS2 is great, but alas some support is still missing
CSS3 is even better but full support of all major
browsers is still lacking

We deserve better-looking websites!
What is a developer to do?
Enter
"Progressive Enhancement"
Progressive Enhancement
Web 1.0 era introduced the "Bleeding Edge"
philosophy:

We do not compromise on design

Our site has to look the same on all supported browsers
We support only browsers that support 100% of our
design
We ignore everyone else
We can't sleep well at night because we're shallow,
narrow-minded people
Progressive Enhancement

Web 2.0 introduced the "Progressive Enhancement"
philosophy:

We support all platform to the best of our ability - The Web is
for everyone!

We compromise on design in favour of wider support - Our
design will not look the same on all platform

We implement a basic design (and functionality) that will work
across the board
Progressive Enhancement
We serve enhanced (bleeding-edge) experience only to
browsers that can support it

We sleep well at night knowing we stayed true to the real
purpose of the Web
CSS3 - Common desired features

  Rounded corners
  Custom fonts
  Box and text shadows
  Multiple-backgrounds
  Transparencies (opacity, rgba, hsla)
  Powerful selectors

And much much more.....
Bridging the gap
Bridging the gap

Rounding the corners:

Firefox: -moz-border-radius
Safari: -webkit-border-radius
Opera / Chrome: border-radius
KHTML: -khtml-border-radius

Internet Explorer ???
Bridging the gap

Rounding the corners in Internet Explorer:

HTML:

<div class="rounded">

<!--[if !IE]
<u class="tl">&nbsp;</u>
<u class="tr">&nbsp;</u>
<u class="bl">&nbsp;</u>
<u class="br">&nbsp;</u>
<![endif]-->
</div>
Bridging the gap

Rounding the corners in Internet Explorer:

CSS:
.rounded{
   position:relative;
   background:#dedede;
}

.tl,.tr,.bl,.br{
    position:absolute;
    background-image:url('/images/corners.png');
    background-repeat:no-repeat;
    width:5px;
    height:5px;
}
Bridging the gap
Rounding the corners in Internet Explorer:
.tl{
   top:0; left:0;
   background-position: top left;
}
.tr{
   top:0; right:0;
   background-position: top right;
}
.bl{
   bottom:0; left:0;
   background-position: bottom left;
}
.br{
   bottom:0; right:0;
   background-position: bottom right;
}
Bridging the gap
Bridging the gap

Adding shadows

Firefox: -moz-box-shadow
Safari/Chrome: -webkit-box-shadow
Opera: box-shadow
KHTML: -khtml-box-shadow

Internet Explorer ???
Bridging the gap

Adding box shadows in Internet Explorer

We need to "trick" the user into thinking our box actually has
something underneath that (sort of) looks like a shadow

We're limited to square boxes (round corners are possible but
more complicated)
We cannot have gradually fading shadow unless we know the
box's dimensions in advance
We can either use a semi-transparent background image or a
simple underlay
Bridging the gap

Adding box shadows in Internet Explorer

HTML:

<div class="shadow">
  <p class="shadowed">
     Some content we want to shadow
  </p>
</div>
Bridging the gap

Adding box shadows in Internet Explorer

CSS:

.shadow{
   position:relative;
   background:#111;
}
.shadowed{
   position:relative;
   top:-1px;
   left:-lpx;
   background:#fff;
}
Bridging the gap

Adding box shadows in Internet Explorer
Bridging the gap

There is a faster, shorter, more effective way to deal with
box shadows on Internet Explorer




              DO NOTHING
Bridging the gap

Custom fonts

Custom fonts have been around for over a decade
They are originally part of CSS2

They are supported by IE since version 4
IE will only support Embedded Open-Type fonts
Other major browsers (latest versions) support
OpenType and TrueType
Bridging the gap

Custom fonts

/* all non-IE browsers */

@font-face {
  font-family: "SomeFont";
  src: url(fonts/myfont.ttf) format("truetype");
}

/* IE */
@font-face {
  font-family: "SomeFont-IE";
  src: url(fonts/myfont.eot);
}
Bridging the gap

Custom fonts

body{
  font-family:"SomeFont-IE","SomeFont", sans-serif;
}
Bridging the gap

Powerful selectors

CSS3 gives us some very powerful selectors

Some may argue that CSS2 selectors are good enough for
nearly everything
One good example is CSS Ninja's custom checkbox / radios
using CSS3 pseudo-selectors
Bridging the gap

CSS3 Please

The site CSS3please gives a perfect example of cross-browser
CSS3 implementation that gracefully degrade in unsupported
browsers.

see css3please.com
Final notes

  Progressive enhancement goes hand-in-hand with
graceful degradation

Avoid hacks and client-side browser detection.

Use either server-side browser detection or
conditional comments to mark your <body> with an
ID for the rendering engine
DO NOT RELY ON JAVASCRIPT - Use Javascript
to enhance a fully functional page!
Final notes

Talk to your designers, convince them or fire them

Compromise on form not on function
Remember the minorities - IE6, Camino, Konqueror,
Opera
Think of mobile browsers
Avoid unjustifiable code
Thank You


                 Zohar Arad,

zohar@zohararad.com | http://www.zohararad.com

Weitere ähnliche Inhalte

Was ist angesagt?

3 Langkah Mudah Membuat Website Dakwah (User Friendly - SEO Friendly - Mobile...
3 Langkah Mudah Membuat Website Dakwah (User Friendly - SEO Friendly - Mobile...3 Langkah Mudah Membuat Website Dakwah (User Friendly - SEO Friendly - Mobile...
3 Langkah Mudah Membuat Website Dakwah (User Friendly - SEO Friendly - Mobile...Wahyu Putra
 
Css best practices style guide and tips
Css best practices style guide and tipsCss best practices style guide and tips
Css best practices style guide and tipsChris Love
 
Introduction to the Web and HTML
Introduction to the Web and HTMLIntroduction to the Web and HTML
Introduction to the Web and HTMLSiddharthBorderwala
 
Le wagon workshop - 2h landing page - Andre Ferrer
Le wagon   workshop - 2h landing page - Andre FerrerLe wagon   workshop - 2h landing page - Andre Ferrer
Le wagon workshop - 2h landing page - Andre FerrerAndré Ferrer
 
Basics of Front End Web Dev PowerPoint
Basics of Front End Web Dev PowerPointBasics of Front End Web Dev PowerPoint
Basics of Front End Web Dev PowerPointSahil Gandhi
 
Design for Developers: Introduction to Bootstrap 3
Design for Developers: Introduction to Bootstrap 3Design for Developers: Introduction to Bootstrap 3
Design for Developers: Introduction to Bootstrap 3John Bertucci
 
Twenty Eleven 詳説 WordBench Osaka #02
Twenty Eleven 詳説 WordBench Osaka #02Twenty Eleven 詳説 WordBench Osaka #02
Twenty Eleven 詳説 WordBench Osaka #02Hishikawa Takuro
 
How to use CSS3 in WordPress - Sacramento
How to use CSS3 in WordPress - SacramentoHow to use CSS3 in WordPress - Sacramento
How to use CSS3 in WordPress - SacramentoSuzette Franck
 
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892Deepak Sharma
 
Intro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersIntro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersSuzette Franck
 
CSS3 - is everything we used to do wrong?
CSS3 - is everything we used to do wrong? CSS3 - is everything we used to do wrong?
CSS3 - is everything we used to do wrong? Russ Weakley
 
CSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and moreCSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and moreRuss Weakley
 
How to dominate a free theme WCTO 2014
How to dominate a free theme WCTO 2014How to dominate a free theme WCTO 2014
How to dominate a free theme WCTO 2014James Strang
 

Was ist angesagt? (19)

3 Langkah Mudah Membuat Website Dakwah (User Friendly - SEO Friendly - Mobile...
3 Langkah Mudah Membuat Website Dakwah (User Friendly - SEO Friendly - Mobile...3 Langkah Mudah Membuat Website Dakwah (User Friendly - SEO Friendly - Mobile...
3 Langkah Mudah Membuat Website Dakwah (User Friendly - SEO Friendly - Mobile...
 
Webmonkey
WebmonkeyWebmonkey
Webmonkey
 
HTML5 CSS3 Basics
HTML5 CSS3 Basics HTML5 CSS3 Basics
HTML5 CSS3 Basics
 
Css best practices style guide and tips
Css best practices style guide and tipsCss best practices style guide and tips
Css best practices style guide and tips
 
Introduction to the Web and HTML
Introduction to the Web and HTMLIntroduction to the Web and HTML
Introduction to the Web and HTML
 
Le wagon workshop - 2h landing page - Andre Ferrer
Le wagon   workshop - 2h landing page - Andre FerrerLe wagon   workshop - 2h landing page - Andre Ferrer
Le wagon workshop - 2h landing page - Andre Ferrer
 
Basics of Front End Web Dev PowerPoint
Basics of Front End Web Dev PowerPointBasics of Front End Web Dev PowerPoint
Basics of Front End Web Dev PowerPoint
 
Design for Developers: Introduction to Bootstrap 3
Design for Developers: Introduction to Bootstrap 3Design for Developers: Introduction to Bootstrap 3
Design for Developers: Introduction to Bootstrap 3
 
Twenty Eleven 詳説 WordBench Osaka #02
Twenty Eleven 詳説 WordBench Osaka #02Twenty Eleven 詳説 WordBench Osaka #02
Twenty Eleven 詳説 WordBench Osaka #02
 
How to use CSS3 in WordPress - Sacramento
How to use CSS3 in WordPress - SacramentoHow to use CSS3 in WordPress - Sacramento
How to use CSS3 in WordPress - Sacramento
 
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
 
Intro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersIntro to Sass for WordPress Developers
Intro to Sass for WordPress Developers
 
CSS3 - is everything we used to do wrong?
CSS3 - is everything we used to do wrong? CSS3 - is everything we used to do wrong?
CSS3 - is everything we used to do wrong?
 
SMACSS Workshop
SMACSS WorkshopSMACSS Workshop
SMACSS Workshop
 
Version Control
Version ControlVersion Control
Version Control
 
Intro to HTML 5 / CSS 3
Intro to HTML 5 / CSS 3Intro to HTML 5 / CSS 3
Intro to HTML 5 / CSS 3
 
CSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and moreCSS - OOCSS, SMACSS and more
CSS - OOCSS, SMACSS and more
 
How to dominate a free theme WCTO 2014
How to dominate a free theme WCTO 2014How to dominate a free theme WCTO 2014
How to dominate a free theme WCTO 2014
 
Ashish
AshishAshish
Ashish
 

Ähnlich wie Progressive enhancement - Bridging the gap between CSS2 and CSS3

CSS3 and a brief introduction to Google Maps API v3
CSS3 and a brief introduction to Google Maps API v3 CSS3 and a brief introduction to Google Maps API v3
CSS3 and a brief introduction to Google Maps API v3 Jeffrey Barke
 
Progressive Enhancement & Intentional Degradation 2
Progressive Enhancement & Intentional Degradation 2Progressive Enhancement & Intentional Degradation 2
Progressive Enhancement & Intentional Degradation 2elliotjaystocks
 
Web performance - Analysing Heart.co.uk
Web performance - Analysing Heart.co.ukWeb performance - Analysing Heart.co.uk
Web performance - Analysing Heart.co.ukgareth53
 
Wp responsive-theme-framework
Wp responsive-theme-frameworkWp responsive-theme-framework
Wp responsive-theme-frameworkDamien Oh
 
CSS Frameworks: Categories, Criteria and Recommendations
CSS Frameworks: Categories, Criteria and RecommendationsCSS Frameworks: Categories, Criteria and Recommendations
CSS Frameworks: Categories, Criteria and Recommendationssirajrkhan
 
DrupalCon Chicago - Best practices for cross-browser compatibility of Drupal ...
DrupalCon Chicago - Best practices for cross-browser compatibility of Drupal ...DrupalCon Chicago - Best practices for cross-browser compatibility of Drupal ...
DrupalCon Chicago - Best practices for cross-browser compatibility of Drupal ...Ovadiah Myrgorod
 
Introduction to HTML5 and CSS3 (revised)
Introduction to HTML5 and CSS3 (revised)Introduction to HTML5 and CSS3 (revised)
Introduction to HTML5 and CSS3 (revised)Joseph Lewis
 
Designing with CSS3 Effectively & Efficiently
Designing with CSS3 Effectively & EfficientlyDesigning with CSS3 Effectively & Efficiently
Designing with CSS3 Effectively & EfficientlyZoe Gillenwater
 
Battle of the Front-End Frameworks: Bootstrap vs. Foundation
Battle of the Front-End Frameworks: Bootstrap vs. FoundationBattle of the Front-End Frameworks: Bootstrap vs. Foundation
Battle of the Front-End Frameworks: Bootstrap vs. FoundationRachel Cherry
 
Making Your Site Look Great in IE7
Making Your Site Look Great in IE7Making Your Site Look Great in IE7
Making Your Site Look Great in IE7goodfriday
 

Ähnlich wie Progressive enhancement - Bridging the gap between CSS2 and CSS3 (20)

CSS3 and a brief introduction to Google Maps API v3
CSS3 and a brief introduction to Google Maps API v3 CSS3 and a brief introduction to Google Maps API v3
CSS3 and a brief introduction to Google Maps API v3
 
The Trouble With Type
The Trouble With TypeThe Trouble With Type
The Trouble With Type
 
Site Manager rocks!
Site Manager rocks!Site Manager rocks!
Site Manager rocks!
 
Html5/CSS3
Html5/CSS3Html5/CSS3
Html5/CSS3
 
Progressive Enhancement & Intentional Degradation 2
Progressive Enhancement & Intentional Degradation 2Progressive Enhancement & Intentional Degradation 2
Progressive Enhancement & Intentional Degradation 2
 
Web performance - Analysing Heart.co.uk
Web performance - Analysing Heart.co.ukWeb performance - Analysing Heart.co.uk
Web performance - Analysing Heart.co.uk
 
Echo HTML5
Echo HTML5Echo HTML5
Echo HTML5
 
Wp responsive-theme-framework
Wp responsive-theme-frameworkWp responsive-theme-framework
Wp responsive-theme-framework
 
CSS Frameworks: Categories, Criteria and Recommendations
CSS Frameworks: Categories, Criteria and RecommendationsCSS Frameworks: Categories, Criteria and Recommendations
CSS Frameworks: Categories, Criteria and Recommendations
 
DrupalCon Chicago - Best practices for cross-browser compatibility of Drupal ...
DrupalCon Chicago - Best practices for cross-browser compatibility of Drupal ...DrupalCon Chicago - Best practices for cross-browser compatibility of Drupal ...
DrupalCon Chicago - Best practices for cross-browser compatibility of Drupal ...
 
Css3 101
Css3 101Css3 101
Css3 101
 
Web fonts
Web fontsWeb fonts
Web fonts
 
Ui development frameworks html-bootstrap by awa
Ui development frameworks html-bootstrap by awaUi development frameworks html-bootstrap by awa
Ui development frameworks html-bootstrap by awa
 
Introduction to HTML5 and CSS3 (revised)
Introduction to HTML5 and CSS3 (revised)Introduction to HTML5 and CSS3 (revised)
Introduction to HTML5 and CSS3 (revised)
 
Edge of the Web
Edge of the WebEdge of the Web
Edge of the Web
 
Using a CSS Framework
Using a CSS FrameworkUsing a CSS Framework
Using a CSS Framework
 
Designing with CSS3 Effectively & Efficiently
Designing with CSS3 Effectively & EfficientlyDesigning with CSS3 Effectively & Efficiently
Designing with CSS3 Effectively & Efficiently
 
Metarefresh
MetarefreshMetarefresh
Metarefresh
 
Battle of the Front-End Frameworks: Bootstrap vs. Foundation
Battle of the Front-End Frameworks: Bootstrap vs. FoundationBattle of the Front-End Frameworks: Bootstrap vs. Foundation
Battle of the Front-End Frameworks: Bootstrap vs. Foundation
 
Making Your Site Look Great in IE7
Making Your Site Look Great in IE7Making Your Site Look Great in IE7
Making Your Site Look Great in IE7
 

Kürzlich hochgeladen

Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 

Kürzlich hochgeladen (20)

Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 

Progressive enhancement - Bridging the gap between CSS2 and CSS3

  • 1. Progressive Enhancement Bridging the gap between CSS2 and CSS3 Zohar Arad, April 2010 zohar@zohararad.com | http://www.zohararad.com
  • 2. Agenda Current situation - Problems with implementing cross-platform web-designs Progressive Enhancement - Solving cross-platform design implementation CSS3 - Common desired features Bridging the gap between CSS2 and CSS3
  • 4. Current Situation There are at least 4 major rendering engines out there: Trident, WebKit, Gecko, Presto Browser version releases and adoption are slow Two camps situation - IE vs. the rest CSS2 is great, but alas some support is still missing CSS3 is even better but full support of all major browsers is still lacking We deserve better-looking websites!
  • 5. What is a developer to do?
  • 7. Progressive Enhancement Web 1.0 era introduced the "Bleeding Edge" philosophy: We do not compromise on design Our site has to look the same on all supported browsers We support only browsers that support 100% of our design We ignore everyone else We can't sleep well at night because we're shallow, narrow-minded people
  • 8. Progressive Enhancement Web 2.0 introduced the "Progressive Enhancement" philosophy: We support all platform to the best of our ability - The Web is for everyone! We compromise on design in favour of wider support - Our design will not look the same on all platform We implement a basic design (and functionality) that will work across the board
  • 9. Progressive Enhancement We serve enhanced (bleeding-edge) experience only to browsers that can support it We sleep well at night knowing we stayed true to the real purpose of the Web
  • 10. CSS3 - Common desired features Rounded corners Custom fonts Box and text shadows Multiple-backgrounds Transparencies (opacity, rgba, hsla) Powerful selectors And much much more.....
  • 12. Bridging the gap Rounding the corners: Firefox: -moz-border-radius Safari: -webkit-border-radius Opera / Chrome: border-radius KHTML: -khtml-border-radius Internet Explorer ???
  • 13. Bridging the gap Rounding the corners in Internet Explorer: HTML: <div class="rounded"> <!--[if !IE] <u class="tl">&nbsp;</u> <u class="tr">&nbsp;</u> <u class="bl">&nbsp;</u> <u class="br">&nbsp;</u> <![endif]--> </div>
  • 14. Bridging the gap Rounding the corners in Internet Explorer: CSS: .rounded{ position:relative; background:#dedede; } .tl,.tr,.bl,.br{ position:absolute; background-image:url('/images/corners.png'); background-repeat:no-repeat; width:5px; height:5px; }
  • 15. Bridging the gap Rounding the corners in Internet Explorer: .tl{ top:0; left:0; background-position: top left; } .tr{ top:0; right:0; background-position: top right; } .bl{ bottom:0; left:0; background-position: bottom left; } .br{ bottom:0; right:0; background-position: bottom right; }
  • 17. Bridging the gap Adding shadows Firefox: -moz-box-shadow Safari/Chrome: -webkit-box-shadow Opera: box-shadow KHTML: -khtml-box-shadow Internet Explorer ???
  • 18. Bridging the gap Adding box shadows in Internet Explorer We need to "trick" the user into thinking our box actually has something underneath that (sort of) looks like a shadow We're limited to square boxes (round corners are possible but more complicated) We cannot have gradually fading shadow unless we know the box's dimensions in advance We can either use a semi-transparent background image or a simple underlay
  • 19. Bridging the gap Adding box shadows in Internet Explorer HTML: <div class="shadow"> <p class="shadowed"> Some content we want to shadow </p> </div>
  • 20. Bridging the gap Adding box shadows in Internet Explorer CSS: .shadow{ position:relative; background:#111; } .shadowed{ position:relative; top:-1px; left:-lpx; background:#fff; }
  • 21. Bridging the gap Adding box shadows in Internet Explorer
  • 22. Bridging the gap There is a faster, shorter, more effective way to deal with box shadows on Internet Explorer DO NOTHING
  • 23. Bridging the gap Custom fonts Custom fonts have been around for over a decade They are originally part of CSS2 They are supported by IE since version 4 IE will only support Embedded Open-Type fonts Other major browsers (latest versions) support OpenType and TrueType
  • 24. Bridging the gap Custom fonts /* all non-IE browsers */ @font-face { font-family: "SomeFont"; src: url(fonts/myfont.ttf) format("truetype"); } /* IE */ @font-face { font-family: "SomeFont-IE"; src: url(fonts/myfont.eot); }
  • 25. Bridging the gap Custom fonts body{ font-family:"SomeFont-IE","SomeFont", sans-serif; }
  • 26. Bridging the gap Powerful selectors CSS3 gives us some very powerful selectors Some may argue that CSS2 selectors are good enough for nearly everything One good example is CSS Ninja's custom checkbox / radios using CSS3 pseudo-selectors
  • 27. Bridging the gap CSS3 Please The site CSS3please gives a perfect example of cross-browser CSS3 implementation that gracefully degrade in unsupported browsers. see css3please.com
  • 28. Final notes Progressive enhancement goes hand-in-hand with graceful degradation Avoid hacks and client-side browser detection. Use either server-side browser detection or conditional comments to mark your <body> with an ID for the rendering engine DO NOT RELY ON JAVASCRIPT - Use Javascript to enhance a fully functional page!
  • 29. Final notes Talk to your designers, convince them or fire them Compromise on form not on function Remember the minorities - IE6, Camino, Konqueror, Opera Think of mobile browsers Avoid unjustifiable code
  • 30. Thank You Zohar Arad, zohar@zohararad.com | http://www.zohararad.com