html - How to make a different background for each link from a navbar? -
how make different background each link navbar?
for example, want 1 photo background home link, photo background link , photo background contact me link.
can done css only???
thank in advance :)
for links
if mean background on links themselves, apply css class name each link , style them individually. example:
<ul> <li class="homelink"><a href="home.html">home</a></li> <li class="aboutlink"><a href="about.html">about</a></li> <li class="contactlink"><a href="contact.html">contact</a></li> </ul>
and in stylsheet
.homelink { background-image:url(/img/home.jpg); } .aboutlink { background-image:url(/img/about.jpg); } .contactlink { background-image:url(/img/contact.jpg); }
for pages
for pages, apply css class name body tag instead of link.
<body class="homepage">...
or ... or ...
and in stylsheet
.homepage { background-image:url(/img/home.jpg); } .aboutpage { background-image:url(/img/about.jpg); } .contactpage { background-image:url(/img/contact.jpg); }
Comments
Post a Comment