How to place a relative element after an absolute element and cause parent div to expand to fit children?

南楼画角 提交于 2019-12-06 06:14:45

position: absolute; takes that object completely out of the document flow. So it's going to appear exactly where you tell it to be with your top: 450px and right or left selectors. That positioning won't effect any other element of your page (unless you cover up another object which will definitely happen without z-index) If you want everything to be placed below #top_object then you need to just float it right or left and then give it whatever margin you need to position it.

Also, overflow: hidden will cut off anything that is outside the defined width or height so you need to define min-width and min-height and then use overflow: auto instead of hidden.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!