CSS: Make two floating elements overlap

前端 未结 8 1558
臣服心动
臣服心动 2021-01-03 19:28

I have two divs within a container. One floats left and one floats right. Both are about 60% as wide as the container and are designed such that they overlap in the middle (

8条回答
  •  清酒与你
    2021-01-03 19:59

    Excellent Solution: http://jsfiddle.net/A9Ap7/237/


    So, dont use:

      MARGIN-LEFT:100px...
    

    == or similar commands.
    The problem is that, if the left elements size is changed, if window is resized or etc,,, then it will make you problems! so, dont use such custom dirty "tricks", but make a normal structure inside html, so they should be naturally ordered.

提交回复
热议问题