Browsersniffing with CSS

October 21st, 2008 § 0

After some research I found the follow css code for sniffing out browsers and emailclients through css. /*Internet Explorer*/
<!--[if IE 7]>
.glue{color: black;}
<![endif]-->

<!–[if IE 6]>
.glue{color: blue;}
<![endif]–>

/* outlook 2007*/

<!--[if gte mso 9]>
.glue{color: aqua;}
<![endif]-->

/* Firefox */
@-moz-document url-prefix() {

.glue { color: red; }
}

/* Opera */
@media all and (-webkit-min-device-pixel-ratio:10000), not all and (-webkit-min-device-pixel-ratio:0) { .glue { color: yellow; }
}

Prototype css selectors and observe

October 9th, 2008 § 0

When using $$ in Prototype, the result is an array. You need to loop through the array to attach the observe function. Expl.
$$(’.myitems‘).each(function(item) { item.observe(’click’,function(){alert (’clicked’)});});

or

$$(’.myitems’).invoke(’observe’, ‘click’, function() {alert(’clicked’)});

Where Am I?

You are currently browsing entries tagged with CSS at westworld: a webmasters best friend.