Position absolute but relative to parent

前端 未结 4 1466
小鲜肉
小鲜肉 2020-11-21 05:33

I have two divs inside another div, and I want to position one child div to the top right of the parent div, and the other child div to the bottom of the parent div using cs

4条回答
  •  南方客
    南方客 (楼主)
    2020-11-21 06:00

    div#father {
        position: relative;
    }
    div#son1 {
        position: absolute;
        /* put your coords here */
    }
    div#son2 {
        position: absolute;
        /* put your coords here */
    }
    

提交回复
热议问题