Get rid of -webkit-padding-start: 40px

user1930845 picture user1930845 · Mar 27, 2015 · Viewed 42.7k times · Source

I am working on adding a menu to a map. The menu is working fine except I noticed there is always a padding to the left no matter what CSS applied to the menu. The padding seems to be originated from (-webkit-padding-start: 40px;) and it does not want to go away. I tried to override it with 0 !important; that didn't do anything.

After Googling found this:

-webkit-padding-start: 40px; What it should be for IE and Firefox?

However could not find anything else on how to override or make this go away. I need to have items in the menu all the way to the left.

enter image description here

Attached is a screenshot, green area is what I am talking about and under styles you can see -webkit-padding-start: 40px;

Answer

sqe picture sqe · Mar 27, 2015

It's because of the user-agent stylesheets of every browser. You should always reset all attributes in your css as your first step.

Short solution:

* {
  margin: 0;
  padding: 0;
}

/* your styling */

Longer solution:

http://meyerweb.com/eric/tools/css/reset/