Seba99
Seba99

Reputation: 1311

CSS - Materializecss - Modal top property overridden automatically

I'm trying to place some tuto modals on my website, so I place them in position:fixed and want them to be at the top and left property I give ..

It seems that top property is automaticalluy changed to top:10% in my inspector ... Why ? :/

The JSFiddle

Upvotes: 3

Views: 1743

Answers (1)

davidkonrad
davidkonrad

Reputation: 85518

Because top: 10%; is injected as inline style to the #test element, and by that has a "higher rank" since it is the last style definition in the chain :

ghpages-materialize.css internal <style> inline style=".."

However, you can use !important to overrule the inline style :

#test {
  position:fixed;
  margin:0px;
  top:400px !important;
  left:0px;
  width:400px;
  height:160px;
  border-radius:40px;
}

updated fiddle -> http://jsfiddle.net/amm85rrs/14/

Upvotes: 2

Related Questions