Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jumpy styles with positions based on the size of an image #6953

Open
notriddle opened this issue Aug 4, 2015 · 2 comments
Open

Jumpy styles with positions based on the size of an image #6953

notriddle opened this issue Aug 4, 2015 · 2 comments

Comments

@notriddle
Copy link
Contributor

@notriddle notriddle commented Aug 4, 2015

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.

@nox
Copy link
Member

@nox nox commented Sep 30, 2017

Is this still true? The URL doesn't work.

@notriddle
Copy link
Contributor Author

@notriddle notriddle commented Sep 30, 2017

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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.