I am mamking a page where there are boxes of contents, and the boxes are responsive so that when there is not enough space, there will be a line break and falls to the other line. I want to absolutely position something relative to the right-most box on the top, so I need a container to have exactly the same width of the boxes, even when I resize the window, and then I can position:absolute the element I want to place there.
I have came across this post. It tells me to use display:inline-block;
to do the trick, but it doesn't work as I expected. See My example here.
I want the blue border container to be exactly the same width of its content when I resize, but not wider.
I have also tried display:inline;
, but it becomes two lines. I want it to be in one box instead so when I use right:0, it will not be referring to the last box on the bottom.
Any idea on this issue? Thanks!