Some CSS frameworks for web forms quick start:
One of those cool CSS3 declarations that you can use today is ::selection, which overrides your browser-level or system-level text highlight color with a color of your choosing. At the time of this writing, only Safari and Firefox are supporting this, and both in slightly different ways.
You may think that html5 and css3 is going to become widespread in something akin to a geologic time scale. The truth is that many html5 and css3 features have currently widespread support.
Below, there is an small snippet to track the browser support for these advanced features for your user base, using google analytics and modernizr.
Modernizr is a small footprint javascript library that let you test the support of html5 and css3 features. With the combination of modernizr and analytics custom vars, we can track which percent of our users support a particular html5 or css3 feature.
So suppose we want to know the user base support for: sessionstorage, localstorage, canvas, fonfaces and borderradius.
Our analytics tracking code would look like:
<script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript" src="/media/js/modernizr-1.1.min.js"></script> <script type="text/javascript"> try { var pageTracker = _gat._getTracker("UA-YYYYY-X"); pageTracker._setCustomVar(1, "sessionstorage", Modernizr.sessionstorage , 2 ); pageTracker._setCustomVar(2, "localstorage", Modernizr.localstorage, 2 ); pageTracker._setCustomVar(3, "fontface", Modernizr.fontface, 2 ); pageTracker._setCustomVar(4, "canvas", Modernizr.canvas, 2 ); pageTracker._setCustomVar(5, "borderradius", Modernizr.borderradius, 2 ); pageTracker._trackPageview(); } catch(err) {}</script>After you append this to your site html body the results are going to appear on analytics under “visitors > custom variables”
Using a similar snippet we found that at www.wegif.com more than 80% of our users support all these features. Cool right?
For more info about how all this works, continue reading at:
http://code.google.com/intl/en/apis/analytics/docs/tracking/gaTrackingCustomVariables.html
Tired of browser specific CSS rules like -moz, -webkit, -o ? Try this small JS library.
Solving CSS Problems With eCSStender - An Event Apart - Chicago 2009
Typotheque Web Font Service demo on Vimeo (via Vimeo)
CSS sprites are a way to reduce the number of HTTP requests made for image resources referenced by your site. Images are combined into one larger image at defined X and Y coorindates. Having assigned this generated image to relevant page elements the background-position CSS property can then be used to shift the visible area to the required component image.
What is a CSS frameworks? What are the advantages and the disadvantages of this approach?