Element: When [Bug Report] uses el-menu components, el-menu-item has a basic style. Padding-left can not cover / using component el-menu got a CSS CSS, it has no effect.

Created on 17 Mar 2018  ·  6Comments  ·  Source: ElemeFE/element

Element UI version

2.2.2

OS/Browsers version

win10家庭版 / chrome the lastest

Vue version

2.5.16

Reproduction Link

https://jsfiddle.net/mmx38qxw/706/

Steps to reproduce

在将侧边栏整体改为 el-menu el-menu-item 过程中, el-menu-item 元素始终有个 padding-left: 20px 的值无法覆盖, 查看chrome的dom盒子, 是在
element.style {
padding-left: 20px;
}
中定义的, 请教如何将其覆盖掉, 高度这些el-menu-item的默认样式已经覆盖掉了, 唯独这个无解

What is Expected?

去除el-menu-item的padding-left

What is actually happening?

el-menu-item 出现无法覆盖的 padding-left

Most helpful comment

solution to this should not be !important.

All 6 comments

Translation of this issue:

Element UI version

2.2.2

OS/Browsers version

Win10 family / Chrome the lastest

Vue version

2.5.16

Reproduction Link

https://jsfiddle.net/mmx38qxw/706/

Steps to reproduce

In the process of changing the sidebar to el-menu el-menu-item, el-menu-item element always has a value of padding-left: 20px, which cannot be overlooked. The DOM box to see Chrome is in.

Element.style {
Padding-left: 20px;

}
What is defined in it, ask how to overlay it, the default style of these el-menu-item has been covered, only this unsolved

What is Expected?

Removal of el-menu-item's padding-left

What is actually happening?

El-menu-item has a padding-left that can't be covered

it works, thanks a lot 忘了这茬了

solution to this should not be !important.

👎 We should avoid !important in our code

If not using !important, may I know the solution to this?

Was this page helpful?
0 / 5 - 0 ratings