Tuesday, October 1, 2013

Browser specific CSS Hacks

11:49 AM Posted by jinto jose , , , , , , , No comments
1. Webkit browser

@media screen and (-webkit-min-device-pixel-ratio:0) {
/* put your styles here */
}

2. IE8

use the \0/ attribute

.elementclass
{
width: 50px\0/; /* This will get only applied to IE8 */
}

3. IE7

use the *

.elementclass
{
*width: 50px; /* This will get only applied to IE7 */
}

4. IE9
using the :root attribute


:root .elementclass
{
/* this style will be applied to IE9 only */
padding-top: 5px;
}



0 comments:

Post a Comment