In spite of this, if the text you??™re intending for a pop-up is important, you should instead
place it within the standard text of your web page, rather than hiding it where most users
won??™t see it. This is especially important when you consider that Firefox crops the values
after around 80 characters, unlike some browsers, which happily show multiline tooltips.
Using CSS when working with images
In the following section, we??™re going to look at relevant CSS for web page images. You??™ll
see how best to apply borders to images and wrap text around them, as well as define
spacing between images and other page elements.
Applying CSS borders to images
You may have noticed earlier that I didn??™t mention the border attribute when working
through the img element. This is because the border attribute is deprecated; adding borders
to images is best achieved and controlled by using CSS. (Also, because of the flexibility
of CSS, this means that if you only want a simple surrounding border composed of flat
color, you no longer have to add borders directly to your image files.) Should you want to
add a border to every image on your website, you could do so with the following CSS:
img {
border: 1px solid #000000;
}
In this case, a 1-pixel solid border, colored black (#000000 in hex), would surround every
image on the site. Using contextual selectors, this can be further refined. For instance,
should you only want the images within a content area (marked up as a div with an id
value of content) to be displayed with a border, you could write the following CSS:
div#content img {
border: 1px solid #000000;
}
Another alternative for extended descriptions for images is the longdesc attribute.
Pages:
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220