Combining position: relative with float in CSS
- by user74847
I have always thought of position: relative and float: left as different tools that should be used separately, with some features that overlap. position should be used for positioning things relative to the viewport and float used for floating things within a container.
Today I saw someone combining float: left and position: relative also using top: 10px, when they could have used margin top on the floated element and not added the position relative at all.
It is obviously not wrong to do it in this way because it works, but what is the best practice? Should position relative be used on an element as well as float?