
-----------------------------------
hamza_saeed007
Wed Jan 05, 2005 5:12 pm

HELP : VERY SIMPLE QUESTION BUT NOT GETTING IT!:
-----------------------------------
hi ,

i just wanted to ask how can we create the shaded hover or mouseover effect . i.e. go to " http://music.msn.com/artist/default.aspx?artist=16074062&app=2   "  rollooer or mouseover the name of the songs
and then see a grey shade that appears on the name of the song.

PLZ HELP.
THANKS

-----------------------------------
wtd
Wed Jan 05, 2005 5:20 pm

Re: HELP : VERY SIMPLE QUESTION BUT NOT GETTING IT!:
-----------------------------------
You start with a bit of text in your HTML:

Hello world!

Now, you make it a link:

Hello world!

Then you give the link an id:

Hello world!

Then you add a stylesheet:





Hello world!

Now, we offer a definition of the "my-link" id in the stylesheet:


   a#my-link {
      /* text color */
      color: #000000;
      /* background color */
      background-color: #FFFFFF;
   }


Hello world!

Now, we define properties for the hover version of the link:


   a#my-link {
      /* text color */
      color: #000000;
      /* background color */
      background-color: #FFFFFF;
   }

   a#my-link:hover {
      background-color: #E8E8E8;
   }


Hello world!

Done.

Read up on Cascadiang Style Sheets.
