css - parent div gets pushed by child, creates gap in parent div -
ok have main div, inside 1 have div , inside 1 have div. im trying last div "float" outside of both of parents, badge want have sticking out of main div. doesnt work how want tho, main div gets expanded background color doesnt cover pixels, can see background of body behind it!
heres code:
#main { background-color: #000; outline: 1px solid #fff; width: 840px; padding: 20px 60px 20px 60px; } #nested1 { width: 100%; position: relative; margin: 0px 0px 10px 0px; } #nested2 { position: absolute; top: 100px; right: -80px; } sorry fuzzy description of problem, knows im talking , can give me pointers on how fix this. thanks!
the #main div won't expand unless there's content inside make stretch, sounds first problem. (the bit of background seeing due padding on #main div.)
if want #nested2 positioned in relation #main, it's better give position: relative #main #nested1.
without seeing whole setup (e.g. html) bit of guessing game. post whole page code, or test page on site jsfiddle?
Comments
Post a Comment