Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to call browser based css?

Tags:

html

css

we can get the browser name from javascript but is there any way to change css accordingly.I mean some classes of css file because I dont want to link another css file , I want to write styles on
if chrome

 a img
{
margin:0;
}

//if mozila

a img
{
margin:5px;
}
like image 730
nectar Avatar asked Aug 02 '10 12:08

nectar


1 Answers

Maybe something like

body.chrome a img
{
margin:0;
}

body.mozilla a img
{
margin:5px;
}

then use Javascript to set a class on the body as required.

like image 102
Matthew Wilson Avatar answered Sep 30 '22 14:09

Matthew Wilson