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

Float images and figures with class containing "right" or "left" #45

Open
waldyrious opened this issue Mar 22, 2018 · 1 comment
Open

Comments

@waldyrious
Copy link
Owner

CSS has been recommended as an alternative to align attributes in img tags for a while now, so it would make sense to recognize (heuristically) cases where such styles have been applied.

This would imply changing the rule added in #40.

@waldyrious
Copy link
Owner Author

waldyrious commented Mar 22, 2018

This will probably be a little tricky if we want to include figures. For example:

<figure class="alignright">
  <img src="https://example.net/foo.jpg" width="100" height="200"/>
  <figcaption>Lorem ipsum</figcaption>
<figure>

...would probably require styling along the lines of:

figure[class *= "right"] { max-width: 50%; float: right; margin: 0; }
/* For images with width attributes: */
figure[class *= "right"] img[width] { width: 100%; height: auto; }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant