Web Development with jQuery®

(Elliott) #1

Programming Conventions (^) ❘ 13
Avoid Making Documents Inaccessible
Accessibility is also an important factor to consider in the design of a web document. You should do
your best to make your JavaScript nonintrusive, but also avoid taking away a document’s accessibil-
ity by either script or markup.
➤ (^) Avoid using frames.
➤ (^) Limit the number of images to those that actually contribute to the content of a document.
With the CSS3, Data URIs and SVG standards, much more of what used to be required
image content for the design of a site no longer has to be included in images and can be pro-
grammed with either CSS3 or SVG (for example, gradients or inner or drop shadows). When
you have to use images, try to contain as much of the design as possible in CSS background
images. Make available double-resolution images for retina or high-resolution devices. And
keep images that directly contribute to the content in elements. Be sure to include alt
attributes that describe the image for each element.
➤ (^) Place content in semantically appropriate markup containers—use

for paragraphs,


through

for headings. Use the new HTML5/XHTML5 elements designed to make
semantic content more semantic: ,
,
Free download pdf