I have css class which sets a span to a particular left position.
left: 0.5em;
How do I override that left value to:
right: 0.5em;
...either inline or in another class?
in other words, how do you set the left value to nothing or null?
If position: absolute; or position: fixed; - the right property sets the right edge of an element to a unit to the right of the right edge of its nearest positioned ancestor. If position: relative; - the right property sets the right edge of an element to a unit to the left/right of its normal position.
The left property affects the horizontal position of a positioned element. This property has no effect on non-positioned elements. If position: absolute; or position: fixed; - the left property sets the left edge of an element to a unit to the left of the left edge of its nearest positioned ancestor.
position: absolute will position the element by coordinates, relative to the closest positioned ancestor, i.e. the closest parent which isn't position: static . Have your four divs nested inside the target div, give the target div position: relative , and use position: absolute on the others.
Perhaps the answer is left: auto
?
Live Demo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With