去掉 -webkit-padding-start: 40px [英] Get rid of -webkit-padding-start: 40px

查看:21
本文介绍了去掉 -webkit-padding-start: 40px的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为地图添加菜单.菜单工作正常,但我注意到无论应用到菜单的 CSS 是什么,左边总是有一个填充.填充似乎源自 (-webkit-padding-start: 40px;) 并且它不想消失.我试图用 0 !important; 覆盖它,但没有做任何事情.

谷歌搜索后发现:

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.

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

解决方案

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/

这篇关于去掉 -webkit-padding-start: 40px的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆