0

I want to set margin and padding for only chrome browser.

how can i set css for only chrome browser because there are some more padding or margin for that

Aron
  • 15,464
  • 3
  • 31
  • 64

2 Answers2

1

Please refer to the following link-- it may surely help you-

How to apply specific CSS rules to Chrome only?

Also you can detect browser with the help of following script --

<script type="text/javascript">
if (navigator.userAgent.toLowerCase().indexOf('chrome')!=-1){
document.write('<link rel="stylesheet" type="text/css" href="your_script.css"/>');
}
</script>
Community
  • 1
  • 1
Pankaj Singh
  • 531
  • 6
  • 21
  • thanks how can i apply for all the browser if i add the above class and comment out for other then it will work only for chrome other it will not work – user2833721 Nov 28 '13 at 10:26
  • @user2833721 --- could you be specific in your details. what actually do you want? i didn't get anything from your comment. – Pankaj Singh Nov 28 '13 at 10:41
  • can you please check this site eheuristic.com/newehs check in both browser the right side Android Application AND Open Source Customization will shown right thing in FF but not in chrome – user2833721 Nov 28 '13 at 10:48
  • @user2833721--- sry dear !! but i didn't found any difference on the page in both the browser-- Firefox and Chrome. Result was exactly same in both the browser. – Pankaj Singh Nov 28 '13 at 11:00
  • Ok Thanks a lot Actually I use Linux so i have problem I check in windows it will work perfect in that – user2833721 Nov 28 '13 at 11:09
  • @user2833721 --- Although it is a bit odd, but can i ask a favor from ur side--- if u think that this answer is useful to you then can u mark this answer as accepted answer. because i need some reputation point. Thanks !! – Pankaj Singh Nov 28 '13 at 11:55
0

try detecting browser using

navigator.userAgent

for further assistance browser detection

once detected in javascript or jquery add the class with margin and padding to the body

Community
  • 1
  • 1
Anobik
  • 4,841
  • 2
  • 17
  • 32