Is it possible to position an element relative to the border-box of its parent?

Posted by Timwi on Stack Overflow See other posts from Stack Overflow or by Timwi
Published on 2014-08-18T15:45:28Z Indexed on 2014/08/18 16:22 UTC
Read the original article Hit count: 201

Filed under:
|
|

Consider the following jsfiddle for reference:

As you can see, the “inner” box (with the red border) is positioned relative to the outer’s padding-box: left:0 positions it just to the right of outer’s border, and top:100% appears to mean “100% of the content plus padding, but not the border”.

Unfortunately, adding box-sizing: border-box to the outer div seems to have no effect.

I want to position a child element directly below its parent’s border-box, i.e. the two borders should abut no matter how thick they are. Is this possible?

© Stack Overflow or respective owner

Related posts about html

Related posts about css