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

image centering to css #6

Closed
wants to merge 1 commit into from
Closed

Conversation

dennisleexyz
Copy link
Contributor

no unnecessary JavaScript 👿

Copy link
Owner

@yihui yihui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are making several assumptions for this to work: 1) images are always block-level elements, which is not necessarily true---images can be inline elements (e.g. emotion icons); 2) there is only one image on a line, which may not be true, either---there could be multiple images side by side on a line. My JS trick also requires assumptions, but I think those assumptions are more reasonable: https://yihui.org/en/2018/11/md-js-tricks/#how-to-center-images-in-paragraphs

Anyway, it is simple enough to add your own CSS to your site. You don't really need my support. Example:

@dennisleexyz
Copy link
Contributor Author

Thanks for the feedback. I'm not concerned about upstreaming all of my changes, I just like to make useful contributions. But you are right, I should have put more thought into this.

@yihui
Copy link
Owner

yihui commented Jun 13, 2020

Thanks anyway!

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

Successfully merging this pull request may close these issues.

2 participants