SlideShare ist ein Scribd-Unternehmen logo
1 von 29
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
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
 
Web Font Replacement
Web Font ReplacementWeb Font Replacement
Web Font Replacementbrinsknaps
 
Twenty Eleven 詳説 WordBench Osaka #02
Twenty Eleven 詳説 WordBench Osaka #02Twenty Eleven 詳説 WordBench Osaka #02
Twenty Eleven 詳説 WordBench Osaka #02Hishikawa Takuro
 
New Web Typography
New Web TypographyNew Web Typography
New Web TypographyMonotype
 
Introduction to the Web and HTML
Introduction to the Web and HTMLIntroduction to the Web and HTML
Introduction to the Web and HTMLSiddharthBorderwala
 
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
 
Intro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersIntro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersSuzette Franck
 
From PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to lifeFrom PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to lifeDerek Christensen
 
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
 
PHPをさわらず作る!デザイナーさんのためのWordPress【超!初級】
PHPをさわらず作る!デザイナーさんのためのWordPress【超!初級】PHPをさわらず作る!デザイナーさんのためのWordPress【超!初級】
PHPをさわらず作る!デザイナーさんのためのWordPress【超!初級】Mami Kuroki
 
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
 
快速开发Css
快速开发Css快速开发Css
快速开发Csstbmallf2e
 
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
 
3- Learn Flexbox & CSS Grid / Container & items
3- Learn Flexbox & CSS Grid / Container & items3- Learn Flexbox & CSS Grid / Container & items
3- Learn Flexbox & CSS Grid / Container & itemsIn a Rocket
 

Was ist angesagt? (20)

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...
 
HTML5 CSS3 Basics
HTML5 CSS3 Basics HTML5 CSS3 Basics
HTML5 CSS3 Basics
 
Web Font Replacement
Web Font ReplacementWeb Font Replacement
Web Font Replacement
 
Twenty Eleven 詳説 WordBench Osaka #02
Twenty Eleven 詳説 WordBench Osaka #02Twenty Eleven 詳説 WordBench Osaka #02
Twenty Eleven 詳説 WordBench Osaka #02
 
New Web Typography
New Web TypographyNew Web Typography
New Web Typography
 
Introduction to the Web and HTML
Introduction to the Web and HTMLIntroduction to the Web and HTML
Introduction to the Web and HTML
 
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
 
Intro to Sass for WordPress Developers
Intro to Sass for WordPress DevelopersIntro to Sass for WordPress Developers
Intro to Sass for WordPress Developers
 
new fonts for the web
new fonts for the webnew fonts for the web
new fonts for the web
 
Bootstrap 3 Basic - Bangkok WordPress Meetup
Bootstrap 3 Basic - Bangkok WordPress MeetupBootstrap 3 Basic - Bangkok WordPress Meetup
Bootstrap 3 Basic - Bangkok WordPress Meetup
 
From PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to lifeFrom PSD to WordPress Theme: Bringing designs to life
From PSD to WordPress Theme: Bringing designs to life
 
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
 
Webmonkey
WebmonkeyWebmonkey
Webmonkey
 
PHPをさわらず作る!デザイナーさんのためのWordPress【超!初級】
PHPをさわらず作る!デザイナーさんのためのWordPress【超!初級】PHPをさわらず作る!デザイナーさんのためのWordPress【超!初級】
PHPをさわらず作る!デザイナーさんのためのWordPress【超!初級】
 
Version Control
Version ControlVersion Control
Version Control
 
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
 
快速开发Css
快速开发Css快速开发Css
快速开发Css
 
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
 
3- Learn Flexbox & CSS Grid / Container & items
3- Learn Flexbox & CSS Grid / Container & items3- Learn Flexbox & CSS Grid / Container & items
3- Learn Flexbox & CSS Grid / Container & items
 

Andere mochten auch

Middle panel font placement tests
Middle panel font placement testsMiddle panel font placement tests
Middle panel font placement testsH Pemberton
 
Audience Feedback Group Stats
Audience Feedback Group StatsAudience Feedback Group Stats
Audience Feedback Group StatsH Pemberton
 
Forms and Conventions Part 2
Forms and Conventions Part 2Forms and Conventions Part 2
Forms and Conventions Part 2H Pemberton
 
Slovensko
SlovenskoSlovensko
SlovenskoHonza
 
Finger stilus - BNL Content House
Finger stilus - BNL Content House Finger stilus - BNL Content House
Finger stilus - BNL Content House BNL Content House
 
Architecting single-page front-end apps
Architecting single-page front-end appsArchitecting single-page front-end apps
Architecting single-page front-end appsZohar Arad
 
Javascript Design Patterns
Javascript Design PatternsJavascript Design Patterns
Javascript Design PatternsZohar Arad
 
Message in a Bottle
Message in a BottleMessage in a Bottle
Message in a BottleZohar Arad
 
Audience Evaluation
Audience EvaluationAudience Evaluation
Audience EvaluationH Pemberton
 
CSS Methodology
CSS MethodologyCSS Methodology
CSS MethodologyZohar Arad
 
Optimum Media OMD Ukraine Best content strategy
Optimum Media OMD Ukraine Best content strategyOptimum Media OMD Ukraine Best content strategy
Optimum Media OMD Ukraine Best content strategyBNL Content House
 
Introduction to HAML
Introduction to HAMLIntroduction to HAML
Introduction to HAMLZohar Arad
 
Shooting Locations
Shooting LocationsShooting Locations
Shooting LocationsH Pemberton
 
Empire State Building
Empire State BuildingEmpire State Building
Empire State Buildinggrouse130
 

Andere mochten auch (15)

Middle panel font placement tests
Middle panel font placement testsMiddle panel font placement tests
Middle panel font placement tests
 
Audience Feedback Group Stats
Audience Feedback Group StatsAudience Feedback Group Stats
Audience Feedback Group Stats
 
Forms and Conventions Part 2
Forms and Conventions Part 2Forms and Conventions Part 2
Forms and Conventions Part 2
 
Slovensko
SlovenskoSlovensko
Slovensko
 
Audience
AudienceAudience
Audience
 
Finger stilus - BNL Content House
Finger stilus - BNL Content House Finger stilus - BNL Content House
Finger stilus - BNL Content House
 
Architecting single-page front-end apps
Architecting single-page front-end appsArchitecting single-page front-end apps
Architecting single-page front-end apps
 
Javascript Design Patterns
Javascript Design PatternsJavascript Design Patterns
Javascript Design Patterns
 
Message in a Bottle
Message in a BottleMessage in a Bottle
Message in a Bottle
 
Audience Evaluation
Audience EvaluationAudience Evaluation
Audience Evaluation
 
CSS Methodology
CSS MethodologyCSS Methodology
CSS Methodology
 
Optimum Media OMD Ukraine Best content strategy
Optimum Media OMD Ukraine Best content strategyOptimum Media OMD Ukraine Best content strategy
Optimum Media OMD Ukraine Best content strategy
 
Introduction to HAML
Introduction to HAMLIntroduction to HAML
Introduction to HAML
 
Shooting Locations
Shooting LocationsShooting Locations
Shooting Locations
 
Empire State Building
Empire State BuildingEmpire State Building
Empire State Building
 

Ähnlich wie Bridging CSS2 and CSS3 with Progressive Enhancement

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
 
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
 
Wp responsive-theme-framework
Wp responsive-theme-frameworkWp responsive-theme-framework
Wp responsive-theme-frameworkDamien Oh
 
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
 
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
 
How To Embed Khmer Fonts On FireFox3.5 , Safari, Opera, Google Chrome
How To Embed Khmer Fonts On FireFox3.5 , Safari, Opera, Google ChromeHow To Embed Khmer Fonts On FireFox3.5 , Safari, Opera, Google Chrome
How To Embed Khmer Fonts On FireFox3.5 , Safari, Opera, Google ChromeChanHan Hy
 

Ähnlich wie Bridging CSS2 and CSS3 with Progressive Enhancement (20)

The Trouble With Type
The Trouble With TypeThe Trouble With Type
The Trouble With Type
 
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
 
Html5/CSS3
Html5/CSS3Html5/CSS3
Html5/CSS3
 
Site Manager rocks!
Site Manager rocks!Site Manager rocks!
Site Manager rocks!
 
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
 
Web fonts
Web fontsWeb fonts
Web fonts
 
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?
 
Wp responsive-theme-framework
Wp responsive-theme-frameworkWp responsive-theme-framework
Wp responsive-theme-framework
 
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)
 
CSS Frameworks: Categories, Criteria and Recommendations
CSS Frameworks: Categories, Criteria and RecommendationsCSS Frameworks: Categories, Criteria and Recommendations
CSS Frameworks: Categories, Criteria and Recommendations
 
Using a CSS Framework
Using a CSS FrameworkUsing a CSS Framework
Using a CSS Framework
 
Css3 101
Css3 101Css3 101
Css3 101
 
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 ...
 
Html5
Html5Html5
Html5
 
How To Embed Khmer Fonts On FireFox3.5 , Safari, Opera, Google Chrome
How To Embed Khmer Fonts On FireFox3.5 , Safari, Opera, Google ChromeHow To Embed Khmer Fonts On FireFox3.5 , Safari, Opera, Google Chrome
How To Embed Khmer Fonts On FireFox3.5 , Safari, Opera, Google Chrome
 
Metarefresh
MetarefreshMetarefresh
Metarefresh
 
Website design2
Website design2Website design2
Website design2
 

Kürzlich hochgeladen

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
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
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 

Kürzlich hochgeladen (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 

Bridging CSS2 and CSS3 with Progressive Enhancement

  • 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. 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!
  • 28. 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
  • 29. Thank You Zohar Arad, zohar@zohararad.com | http://www.zohararad.com