I searched from somewhere and found that a lot of people says a basic concept for implementing this feature looks like below:
HTML code:
However, I had a lot of grand-parents in my case and the above code didn't work. Therefore, I needed an alternative. I presumed that my app uses Boostrap and AngularJs, maybe some CSS from them affects mine. I didn't know exactly the problem, but I believed when all CSS is loaded into my browser, I could completely handle it.
I tried to create an example to investigated this problem by Fiddle. Accidentally, I just changed: position: parent; to position: static; for one of parents -> the problem is solved.
Look at my code:
Can check my example here: https://jsfiddle.net/qo44z771/
References:
[1]. http://front-back.com/how-to-make-absolute-positioned-elements-overlap-their-overflow-hidden-parent
[2]. http://stackoverflow.com/questions/14605639/how-to-overlap-parent-div-from-child-div
HTML code:
<div id="parent"> <div id="child"> </div> </div>And, CSS:
#parent{ position: relative; overflow:hidden; } #child{ position: absolute; top: -1; right: -1px; }
However, I had a lot of grand-parents in my case and the above code didn't work. Therefore, I needed an alternative. I presumed that my app uses Boostrap and AngularJs, maybe some CSS from them affects mine. I didn't know exactly the problem, but I believed when all CSS is loaded into my browser, I could completely handle it.
www.tom-collinson.com
I tried to create an example to investigated this problem by Fiddle. Accidentally, I just changed: position: parent; to position: static; for one of parents -> the problem is solved.
Look at my code:
<div class="modal-body dn-placeholder-parent-position"> <div class="form-horizontal"> <div class="form-group"> <label class="col-sm-2">Name</label> <div class="col-sm-9"> .... </div> </div> <div class="form-group"> <label class="col-sm-2">Help text</label> <div class="col-sm-9"> ... </div> <div class="col-sm-3 dn-placeholder-position"> <dn-placeholder> .... </dn-placeholder> </div> </div> </div> </div>CSS
.dn-placeholder-parent-position{ position: static; } .dn-placeholder-position{ padding: 0px; margin-top: 7px; position: absolute; right: -93px }
Can check my example here: https://jsfiddle.net/qo44z771/
References:
[1]. http://front-back.com/how-to-make-absolute-positioned-elements-overlap-their-overflow-hidden-parent
[2]. http://stackoverflow.com/questions/14605639/how-to-overlap-parent-div-from-child-div
Comments
Post a Comment