Strange css code

I stumbled upon this piece of code :


#main ul a.selected {
  margin-bottom:0;
  color:#000;
  background:snow;
  border-bottom:1px solid snow;
  cursor:default;
  }
#main div {
  padding:10px 10px 8px 10px;
  *padding-top:3px;
  *margin-top:-15px;
  clear:left;
  background:snow;
  height: 300px ;
}

I know what most of this code does, but I wonder what that asterisks and that snow value do!
Any ideas?
Thank you.

Well snow is a color name for #FFFAFA, apparently, so that’s just setting the background color to #FFFAFA. The * would be the universal selector hack (I think…). Here is SP thread which might help: http://www.sitepoint.com/forums/showthread.php?534818-What-Does-The-Asterisk-Mean-In-A-CSS-Rule

Close dave, it’s actually the invalid character hack for IE7 and lower.

As a rule of thumb if you need hacks to do margin or padding adjustments like that, there’s something wrong with how the page is built.

Crap - thought I had it right.

Your rule of thumb is pretty accurate though as I’ve never needed to use it, or if I found a need for this hack (and I’ve had to fight IE7 on down a lot), I reworked it to find a better way to code the page and style it.