Image over Image CSS

前端 未结 4 1148
一生所求
一生所求 2021-02-08 05:06

I am creating a webpage and I am trying to put a png (buttons) over gif files. When the page renders, it makes the png file appear after or under the gif file. I tried using an

4条回答
  •  天命终不由人
    2021-02-08 05:29

    Each element in a page has a particular stacking order. If you do not set them explicitly then it will be stacked in accordance to the order in DOM.

    You can control the stacking order by setting the property

    z-Index

    The higher the z-index value goes the higher will be the stacking order for the element.

    If you can set the gif image as the background of a cell then

    background-image

    property will be the best one. First set the gif image as a background to the cell and place the png button in the cell and position it inside the cell.

提交回复
热议问题