How to position an HTML element on top of another element without affecting the layout of the element(s) beneath?

后端 未结 3 971
野趣味
野趣味 2021-01-05 21:44

Generally speaking, HTML layout is flow-based. Each element gets positioned after the one before it, either to the right of it or beneath it. There are plenty of exception

3条回答
  •  醉酒成梦
    2021-01-05 22:26

    If you use

    table {position:relative;}
    

    then you can use:

    table img {
        position:absolute;
        top: #px;
        left: #px;
    }
    

    This will offset the image to a particular location within the containing table and take it out of the flow of the rest of the table around it.

提交回复
热议问题