HTML and CSS Reference
In-Depth Information
That style attribute does not specify a color for links as the original body tag does. To
set the link color for all the links on a page, you need to use a style sheet for the page
and specify the style for the <a> tag, like this:
<style type=”text/css”>
a { color: #ff9933; }
What about active links and visited links? CSS provides pseudo-selectors that apply to
links in particular states, as follows:
Applies to unvisited links.
Applies to links which the user has visited.
Applies to links when the user has her mouse pointer over the
Like the alink attribute, this selector is used when the user is
clicking on the link.
As you can see, these selectors provide access to an additional state that the old attributes
did not, the hover state. Here's an example that specifies the colors for links in each of
their states:
<style type=”text/css”>
a { color: #ff9933; }
a:visited { color: #bbbbbb; }
a:hover { color: #E58A2E; }
a:active { color: #FFA64D; }
Image Backgrounds
The last topic in this lesson is using an image as a background for your pages, rather
than simply a solid-colored background. When you use an image for a background, that
image is tiled ; that is, it's repeated in rows to fill the browser window.
To create a tiled background, you need an image to serve as the tile. Usually, when you
create an image for tiling, you must make sure that the pattern flows smoothly from one
tile to the next. You can do some careful adjusting of the image in your favorite image-
editing program to make sure that the edges line up. The goal is for the edges to meet
cleanly so that you don't have a seam between the tiles after you've laid them end to end.
(See 9.19 for an example of tiles that don't line up very well.) You also can try clip art
packages for wallpaper or tile patterns that are designed as tiles. Some graphics pack-
ages, such as Photoshop, can also modify your images so that they work as tiles. This
feature works better with some kinds of images than others.
Search WWH ::

Custom Search