HTML and CSS Reference
In-Depth Information
or browser bug. Instead, it provides feature detection, the results of
which can be referenced from your CSS or JavaScript code. Classes such
as .multiplebgs or .no-multiplebgs are added to the <html> element
of your document, allowing you to define an alternate set of styles.
More Targeted Solutions
Another class of scripts does not attempt to fix a group of CSS features
or fix a specific browser's problems, instead targeting a very specific
CSS feature.
The rounded corners discussion in Chapter 8 mentioned using JavaScript
to create DOM elements to apply rounded corner effects for browsers
that do not support the border-radius property. CurvyCorners ( http://
www.curvycorners.net/ ) is one library that does this for you and is an
example of a library that is used to target one specific gap in browser
support rather than going after a larger class of problems.
Why Not Use JavaScript?
These JavaScript libraries can be useful to bring a browser in line with
the A-grade browsers you're targeting with your CSS code, but they can
be overkill. By design, many of these libraries attempt to fix most or all
problems with a browser, whereas your project may have only one or two
unsupported features or browser bugs that need to be fixed. Why load a
script to add support for the :not() selector or border-radius property
if it doesn't appear in your code?
When there are just a few features that would have to be fixed in this
manner, it may be more efficient to find alternate ways to code the
effects through CSS and HTML rather than turn to scripting. There may be
other selectors you can use, for example. In browsers with lower usage, it
may be OK just to leave things unsupported.
 
 
Search WWH ::




Custom Search