I know stylesheets are the best place for CSS, but I was wondering if there was any way to add CSS specific to Firefox using jQuery.
The typical way to add CSS using jQuery uses this syntax:
$('select').css('margin', '1em');
The CSS query specific to Firefox is something like this:
@-moz-document url-prefix() {
select {
padding: 0.25em;
margin-top: -0.2em;
}
}
Is there a way to adapt the jQuery CSS command to use the Firefox media query?
I suppose if there was a way then it can be made to work for Chrome, Safari and IE as well.
Is there a way to adapt the jQuery CSS command to use the Firefox media queryNo. They rely on the selectors only available in a stylesheet, not on inline styling. You shouldn't really be doing this anyway. This may be caused by the slight differences in the browsers default styles, in which case I'd suggest you include a reset stylesheet before adding your own styles.