HTML and CSS Reference
In-Depth Information
To i m p l e m e n t i c To n is To n a we b p a g e , a rg u a b l y t h e b e is t m e t h To d i is t To u is e C S S b ac k-
ground images. Using the <img> tag is workable, but not the best way, because
icons are not really content; rather, they support content, plus <img> elements
affect content layout on the page and are more fiddly to place where you want.
Let's look at a quick example. You'll find the full code for this in the file basic-
icons.html in the chapter6 code download folder. You first need to attach the images
to the elements you want them to appear on:
ul li:nth-of-type(1) a {
: ;
ul li:nth-of-type(2) a {
: ;
ul li:nth-of-type(3) a {
: ;
ul li:nth-of-type(4) a {
: ;
Search WWH ::

Custom Search