Prev | Current Page 248 | Next

Craig Grannell

"The Essential Guide to CSS and HTML Web Design"

Complying with the W3C??™s Web Content Accessibility Guidelines
(WCAG), the script also warns when new windows are about to be opened. Ultimately,
though, you should avoid new windows whenever possible. For occasions when you want
to provide a temporary new window (such as for a terms-and-conditions box during a
checkout process), use a JavaScript pop-up, or place the terms inline by using a scrollable
content area (see Chapter 7 for more on those).
Links and images
Although links are primarily text-based, it??™s possible to wrap anchor tags around an image,
thereby turning it into a link:
?? height="40" />
Some browsers border linked images with whatever link colors have been stated in CSS (or
the default colors, if no custom ones have been defined), which looks nasty and can displace
other layout elements. Historically, designers have gotten around this by setting the
border attribute within an img element to 0, but this has been deprecated. Therefore, it??™s
best to use a CSS contextual selector to define images within links as having no border.
a img {
border: 0;
}
Clearly, this can be overridden for specific links. Alternatively, you could set an ???invisible???
border (one that matches the site??™s background color) on one or more sides, and then set
its color to that of your standard hover color when the user hovers over the image. This
would then provide visual feedback to the user, confirming that the image is a link.


Pages:
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260