Hi Garfield,
This is a common problem and easy to deal with as has been explained above quite well. The problem with gifs is the way
PS creates blurs and blends (the usual method of creating shadows or antialiasing) with the background color. Since gifs use 256 colors (indexed) there are not too many colors to match the background plus gifs usually (there is a workaround to this) only use one color as the transparency color, in other words the color that will be replaced with transparency (the background). So if the shadow blurs from black to white in 30 steps only the last step (the actual white pixels) will show background thru the transparency. This of course is not what you want. What you end up with is a cloud around your design instead of a smooth blurred shadow. This is not a problem if the background is white but any other color will show the ugly cloud.
This is why you create your design on the backgound you intend to use (if you use gif) then crop the image to a size just large enough to include the shadow. This will put a small margin of background around the design so it will lay over the background on the web. When you save for web you can furthur tweak the index colors and type of compressions to get the smallest file with the best results.
With jpeg there is no transparency so you are forced to follow the above proceedure to accomplish the same thing.
In short, both gifs and jpegs (in this particular situation) act the very same with the sole exception of gifs on white backgrounds.
To answer your question about the difference between gifs and jpegs. The main difference is in how they deal with compression. Gifs are good for designs there there are large areas of single colors, jpegs are good with designs that are complex such as photos. That is the reason you usually hear the phrase use gifs with graphics (meaning designs) and jpeg with photos (meaning complicated patterns of color). You will also be more likely to have to deal with compression artifacts (distortions) with jpeg compression than with gifs. This is the reason jpegs are good with complex designs like photos. First there is less likehood of artifacts since the the color patterns change so frequently in a photo (on a pixel level) and any artifacts that are created tend to blend into the image and are camoflaged.
But of course we now have the miracle of slices available to us with the later versions of
PS. Slices as you probably know allow you to take any image and divide it into a mossaic of user defined pieces and then decide which type of image it will be saved as, gif or jpeg. This gives you the best of both worlds.
And dont forget about png, but thats for another day.
Tex