Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set margin-top for Chrome browser only?

Tags:

css

How to set margin-top for Chrome browser only? It looks like there's no -webkit-margin-top attribute in CSS.

like image 982
injoy Avatar asked Jan 30 '16 01:01

injoy


2 Answers

Hmm that should work, unfortunately i can't comment, but try this

-webkit-margin-before: 100px;

That might fix the problem.

like image 95
Casper Avatar answered Dec 04 '22 22:12

Casper


You can always do browser recognition in JS and then apply different base classes for different browsers. Also, this will make you happier when you look at your code in a year or two, rather than using CSS hacks which may or may not exist at that point.

like image 34
Shomz Avatar answered Dec 05 '22 00:12

Shomz