четвъртък, юни 10, 2010

CSS elements hack for IE browsers

If an element has to have a different CSS element value for IE 6 or IE 7 than other browsers like IE 8, Firefox, Opera, etc., the syntax is like this:

.myelement
{
   margin:10px; /* this is normal styling for all browsers */
   _margin:20px; /* this will overwrite the above style for IE 6 browser */
   *margin:30px; /* this will overwrite the above styles for IE 7 browser */
}

That means that with underscore (_) you get a style that will be applied in IE 6 browser only and with asterisk (*) you get a style that will be applied in IE 7 browser.

Няма коментари: