Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upJumpy styles with positions based on the size of an image #6953
Labels
Comments
|
Is this still true? The URL doesn't work. |
|
Unfortunately, I don't have that file any more. Forgot it was there. The HTML for it looked like this: <div style="text-align:center">
<div style="position:relative;display:inline-block">
<img src="some-image">
<div style="position:absolute;top:0;left:100%">This text should end up to the right of the image</div>
</div>
</div>The image has to finish loading after the initial layout, which is why I didn't just paste it in here originally. Next time, I'll try to copy relevant info. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://www.notriddle.com/servo-bug-relative-to-image.html
By combining inline-block, relative positioning, and absolute positioning, it's possible to have stuff stuck to the sides of a dynamically-sized image. Except that the item doesn't move when the image's real size is learned.