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?
See Question&Answers more detail:os