SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

Tendances

Web Font Replacement
Web Font ReplacementWeb Font Replacement
Web Font Replacement
brinsknaps
 
Twenty Eleven 詳説 WordBench Osaka #02
Twenty Eleven 詳説 WordBench Osaka #02Twenty Eleven 詳説 WordBench Osaka #02
Twenty Eleven 詳説 WordBench Osaka #02
Hishikawa Takuro
 
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
Sahil Gandhi
 
快速开发Css
快速开发Css快速开发Css
快速开发Css
tbmallf2e
 

Tendances (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
 

En vedette (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
 

Similaire à Progressive enhancement

Progressive Enhancement & Intentional Degradation 2
Progressive Enhancement & Intentional Degradation 2Progressive Enhancement & Intentional Degradation 2
Progressive Enhancement & Intentional Degradation 2
elliotjaystocks
 
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
 
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
 

Similaire à 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
 

Dernier

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
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
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

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