Absolute position and Overflow:hidden

后端 未结 8 1072
暖寄归人
暖寄归人 2020-11-29 03:16
8条回答
  •  感情败类
    2020-11-29 03:43

    Use css...

    * {margin: 0; padding: 0;}
    
    #parent {width: auto; overflow: hidden;}
    
    #child {position: absolute; width: auto;}
    

    With width auto it will always append to the smallest possible size; and with the reset it will help maintain natural flow.

    But if the child is bigger in any way than the parent, then it will not be possible. But with this CSS I think you will achieve what you want to the maximum of what is possible.

提交回复
热议问题