It??™s not fully supported, but Firefox, SeaMonkey, and Netscape display the
attribute??™s contents as a description field when you view image properties. It??™s
also fully supported in the JAWS screen reader, thereby warranting its use
should your image descriptions be lengthy.
THE ESSENTIAL GUIDE TO CSS AND HTML WEB DESIGN
136
Alternatively, you could set borders to be on by default, and override them in specific
areas of the website via a rule using grouped contextual selectors:
img {
border: 1px solid #000000;
}
#masthead img, #footer img, #sidebar img {
border: 0;
}
Finally, you could override a global border setting by creating a noBorder class and then
assigning it to relevant images. In CSS, you??™d write the following:
.noBorder {
border: 0;
}
And in HTML, you??™d add the noBorder class to any image that you didn??™t want to have a
border:

?? alt="A photo of a sunset" />
Clearly, this could be reversed (turning off borders by default and overriding this with, say,
an addBorder style that could be used to add borders to specific images). Obviously, you
should go for whichever system provides you with the greatest flexibility when it comes to
rapidly updating styles across the site and keeping things consistent when any changes
occur. Generally, the contextual method is superior for achieving this.
Although it??™s most common to apply borders using the shorthand shown earlier, it??™s possible
to define borders on a per-side basis, as demonstrated in the ???Using classes and CSS
overrides to create an alternate pull quote??? exercise in Chapter 3.
Pages:
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221