I’m looking of a way to solve a problem, I’m making a map with locations, locations are indicated by dots, however I’ve been using position:relative; so it counts the top-left from the top of the container, but now i’ve realised that it’s not done by that and it shifts down as there are several ‘dots’, I can’t find a way to work around this, is there an easy way to this?
Preview: removed have a look at the dots by missisipy(by the sea) and the dot to the right, they are mean to be at the same height, but they aren’t..
I would think position:absolute might be better. relative will calc from the original position.
exact quote from w3schools:
A relative positioned element is positioned relative to its normal position.
most likely in the original DOM structure the one “dot” is above the other so if the position for height is the same then one would be higher than the other as you are seeing.
however for absolute, another direct w3s quote:
An absolute position element is positioned relative to the first parent element that has a position other than static. If no such element is found, the containing block is html:
absolute should work without changing anything else as long as there isnt a parent element with a position other than static. If there is then rework the numbers and you should be good.
fixed could work as well but that would cause issues if the viewing screen isnt large enough for the whole map, which mine was so not an issue here but…