I have this CSS code:
#div1{
height:200px;
width:200px;
background-color:red;
position:absolute;
right:30px !important;
left:0px;
}
I want to ask why left:0px;
overrides right:30px !important
and not the opposite. Or the one with !mportant
should override the other, that sounds more logical to me.
As PaulD.Waite pointed out it’s more that the left
and width
rules override the right
rule.
So the real question is
Why left is given precedence over right when there’s a width?
FIDDLE
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…