tech support 8

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Monday, 19 July 2010

Working Around CSS3 Hacks

Posted on 12:19 by Unknown

HTML5, CSS3Until CSS3 is a final specification, we can expect to see browser makers attempting to implement some of the ideas on their own, sometimes with a nod to the forthcoming spec and sometimes without a clear correlation. Given the pressure for browser makers to claim support for a CSS3 feature as soon as possible (Does Your Browser Really Support HTML5 and CSS3? and HTML5 and CSS3 Confusion), these implementations aren't always complete or terribly close to what the final specification will require. If you're the kind of developer who just cannot wait for the W3C to wrap things up (and they still haven't finished CSS 2.1: CSS 2.1 Still Not Final), then you probably want to try your hand at using these new features, at least implemented by the browser makers. Take some time to read up on some best-practices articles that can save you a lot of time down the road as you have to re-factor your code.



In late June the article Stop Forking with CSS3 showed up on A List Apart and promoted the use of a JavaScript library over browser-specific prefixes (vendor prefixes). The author felt that the pre-pended CSS styles (such as -moz, -webkit, -o, and -khtml) were just the modern form of CSS hacks we've been using as patches through a decade of shoddy support from browsers. I am not a fan of using client-side script to make my CSS (or HTML) coding easier — I don't like to put the processing burden on every end user instead of simply writing more code. Others agreed, as this sample comment (from Bruce Lawson) highlights: vendor prefixes are a feature, not a bug



Bruce Lawson proposed his own approach in early June, Writing cross-browser, future-proof CSS 3. He argues that developers need to learn the standards in the specification and include them in the code, regardless of browser support. Then a developer can add the browser-specific hacks on top of that. This way when support for the standard emerges, no code changes are necessary. As browsers start to drop support for their browser-specific hacks, still no code changes are necessary. This is valuable for contract work when your client pays you to develop and deploy a site and months later the rules change. Now you don't get a panicked phone call about changes to the site appearance and you don't have to incur expense (yours or the clients) to fix your code. Some of the comments on the post discuss ways to separate and format the browser specific styles for later removal.



Earlier this month Eric Meyer weighs in at A List Apart with Prefix or Posthack. Here he suggests that browser-specific prefixes are the best way for browser makers to introduce new support. As the specification and/or the support is/are finalized, then browser makers should drop the prefixes. As developers, these prefixes are clues that things are still in a state of flux. At the very least, if implementations differ dramatically, it's far easier to include a prefix to specifically target each browser than to look for hacks or write browser-sniffing scripts.



Loathe though I am to write any browser-specific code, I endorse the approach outlined by Eric Meyer. Add in some of Bruse Lawson's suggestions (such as ordering the prefixes in alphabetical order) and you should have future-friendly CSS that doesn't exist solely at the whim of browser makers, but still allows you to play with these new CSS toys.

Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in browser, css, standards, W3C | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Browser Performance Chart
    Jacob Gube has posted a handy chart over at Six Revisions titled " Performance Comparison of Major Web Browsers ." He tests the c...
  • Google Dashboard: What Google Knows about You
    Google announced a new service/feature today, Google Dashboard . Given all the services Google offers and all the ways you can interact with...
  • Facebook, HTML5, and Mis-Reporting
    My Twitter stream and the headlines of sites across the web yesterday lit up with Facebook's CEO blaming its stock price (failure to mee...
  • The Science of Trust in Social Media
    I am one of those people who always needs to see proof of some assertion, evidence to back up a claim. While I can accept anecdotal evidence...
  • App Store Meta Tags
    Why yes, Dominos, I'd love to tap again to get your real home page to order a pizza when I could have done it right here, below your ove...
  • Speaking at Mom 2.0 in Houston, TX
    I will be in Houston this week to speak at the Mom 2.0 Summit (Feb. 18-20, 2010, Houston, TX). To make it a little easier to describe, here...
  • Codepen Has Handy Sharing Tools for Devs
    There are plenty of online resources for playing around with code right in the browser, no server of your own needed, that you can then shar...
  • History of Eye-Tracking as Research Tool
    If you've ever wondered what eye-tracking is and where it came from, there is a historical breakdown in the article A Brief History of E...
  • Opera: Presto! It's now WebKit
    Opera is replacing its Presto rendering engine with WebKit (Chromium, really, when you factor in the V8 JavaScript rendering engine). Big n...
  • Developer Discusses Dyslexia and Dyscalculia
    Sabrina Dent , a web designer hailing from Ireland, has blogged about her struggle with dyslexia and dyscalculia and web applications today...

Categories

  • accessibility
  • Adobe
  • analytics
  • Apple
  • apps
  • ARIA
  • Bing
  • Blink
  • Brightkite
  • browser
  • Buzz
  • Chrome
  • clients
  • css
  • design
  • Facebook
  • Firefox
  • Flash
  • fonts
  • food
  • Foursquare
  • g11n
  • geolocation
  • globalization
  • Google
  • Gowalla
  • html
  • i18n
  • ICANN
  • infographic
  • Instagram
  • internationalization
  • internet
  • Internet Explorer
  • JavaScript
  • JAWS
  • Klout
  • L10n
  • law
  • localization
  • Lynx
  • Mapquest
  • Microsoft
  • mobile
  • Netscape
  • ning
  • Opera
  • patents
  • picplz
  • Plus
  • print
  • privacy
  • project management
  • QR
  • rant
  • RSS
  • Safari
  • SCVNGR
  • search
  • SEM
  • SEO
  • social media
  • Sony
  • speaking
  • standards
  • SVG
  • touch
  • translation
  • Twitter
  • typefaces
  • usability
  • UX
  • Verizon
  • video
  • W3C
  • WAI
  • WCAG
  • WebKit
  • whatwg
  • Wired
  • WOFF
  • xhtml
  • Yahoo
  • YouTube

Blog Archive

  • ►  2013 (39)
    • ►  December (1)
    • ►  November (7)
    • ►  September (4)
    • ►  July (3)
    • ►  June (2)
    • ►  May (5)
    • ►  April (3)
    • ►  March (6)
    • ►  February (2)
    • ►  January (6)
  • ►  2012 (63)
    • ►  December (2)
    • ►  November (4)
    • ►  October (5)
    • ►  September (5)
    • ►  August (4)
    • ►  July (6)
    • ►  June (7)
    • ►  May (7)
    • ►  April (8)
    • ►  March (5)
    • ►  February (3)
    • ►  January (7)
  • ►  2011 (67)
    • ►  December (5)
    • ►  November (7)
    • ►  October (5)
    • ►  September (4)
    • ►  August (8)
    • ►  July (3)
    • ►  June (8)
    • ►  May (3)
    • ►  April (1)
    • ►  March (6)
    • ►  February (6)
    • ►  January (11)
  • ▼  2010 (100)
    • ►  December (8)
    • ►  November (7)
    • ►  October (5)
    • ►  September (10)
    • ►  August (7)
    • ▼  July (11)
      • Trying Google Font Previewer
      • Unicorn Validator
      • This, the F**k, Is Social Media Now
      • Opera Rep Provides HTML5 Overview
      • W3C Cheat Sheet Now Includes HTML5
      • Working Around CSS3 Hacks
      • CSS 2.1 Still Not Final
      • Methods to Select an HTML5 Element
      • Does Your Browser Really Support HTML5 and CSS3?
      • UX Challenges in Touch Interfaces (at evolt.org)
      • Social Media Day in Buffalo #smdayBUF
    • ►  June (12)
    • ►  May (6)
    • ►  April (8)
    • ►  March (10)
    • ►  February (5)
    • ►  January (11)
  • ►  2009 (51)
    • ►  December (9)
    • ►  November (6)
    • ►  October (21)
    • ►  September (13)
    • ►  August (2)
  • ►  2003 (3)
    • ►  October (1)
    • ►  January (2)
  • ►  2002 (9)
    • ►  December (1)
    • ►  June (3)
    • ►  April (1)
    • ►  March (3)
    • ►  January (1)
  • ►  2001 (1)
    • ►  February (1)
  • ►  2000 (4)
    • ►  October (1)
    • ►  July (1)
    • ►  June (1)
    • ►  January (1)
  • ►  1999 (7)
    • ►  November (1)
    • ►  September (2)
    • ►  August (2)
    • ►  July (1)
    • ►  June (1)
Powered by Blogger.

About Me

Unknown
View my complete profile