
Other solution, demoed in this fiddle :, as suggested by MilanSxD, to use inline-block elements.
Stick a div to fluid image how to#
One solution would be to add a wrapping div element with correct aspect ratio, then both image and overlay could be inner elements with absolute full width and height, however, I don't know how to do that in a way that this div would be fully fluid in the container div image), so the red dot does not stick to its position relatively to the image.Īny idea how to achieve this without javascript ? Stick the navbar to the top of the window by using fixed top-0 right-0.

Problem is : The overlay has the wrong dimensions (. Use responsive jumbotron component with helper examples for background image. This can be really useful if you want to stick an element thats.

