Suppose there are 4 blocks on the page and 1 block located absolute. How to make it so that when you hover on a black block, the block was on the right side of the black block.
div { width: 150px; height: 150px; background: #000; } .left { float: left; } .l_b { float: left; margin-top: 250px; } .right { float: right; } .r_b { float: right; margin-top: 250px; } .hover_bl { width: 50px; height: 50px; background: red; position: absolute; top: 60px; left: 158px; } <div class="left"></div> <div class="right"></div> <div class="l_b"></div> <div class="r_b"></div> <div class="hover_bl"></div>