Easy Way to Hacks for IE7 in CSS

A less memorable way to target IE7 browser using hacks.

.element
{  
    margin-bottom: 20px;  
    *margin-bottom: 10px;  
}  

The “hack” is the asterisk at the start of the line of CSS that you want to apply to IE7. 

Note: This will also apply to IE6. So you should only use this if you know that this hack will look fine in IE6, or if you don't care what it looks like in IE6. So if you've dropped support for IE6, then this should be fine.

Ebook Download
View all
Learn
View all