Table with div layers

和自甴很熟 提交于 2019-12-11 16:24:25

问题


I have a table inside a div 1.

Then after that div 1 added another div 2 with position:relative; top:-250; so that div 2 layer will be right on top of the table. But now below the table there is a big space before anything on the page can resume displaying (I guess the second div 2 would have normally been without the -250 position change?)
How do I get rid of the space and clear it? I tried this... <div style="clear:both;"></div> ...and it didn't do anything


回答1:


Using absolute positioning rather than relative may do the trick. I'll test this theory and edit my answer accordingly.

Edit: using position: absolute; margin-top: -250px; seems to be the solution.



来源:https://stackoverflow.com/questions/3844201/table-with-div-layers

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