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

:align: center doesn't work #9

Closed
mithro opened this issue Jun 19, 2020 · 4 comments · Fixed by #11
Closed

:align: center doesn't work #9

mithro opened this issue Jun 19, 2020 · 4 comments · Fixed by #11

Comments

@mithro
Copy link
Member

mithro commented Jun 19, 2020

From what I can tell, the :align: center; doesn't work on an .. image (and probably else where).

.. image:: image.png
    :align: center

This seems to be because the :align: center; adds the following css;

.align-center, .align-default {
    margin-left: auto!important;
    margin-right: auto!important;
}

However a .img is an inline element so the margin-left: auto; margin-right: auto; trick doesn't work.

This seems to be fixed by applying the display: block css to the element.

@mithro
Copy link
Member Author

mithro commented Jun 19, 2020

@daniellimws -- Can chance you could see if the display:block; solution doesn't break anything else?

@daniellimws
Copy link
Collaborator

I tried with .. figure, and it needs text-align: center; to work.

.align-center {
    margin-left: auto !important;
    margin-right: auto !important;
    display: block;
    text-align: center;
}

I think only image and figure uses the :align: option? So I think it should be fine.

@mithro
Copy link
Member Author

mithro commented Jun 22, 2020

@daniellimws -- Want to send a pull request to fix?

@daniellimws
Copy link
Collaborator

Sure, back from a long hiatus yay

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 a pull request may close this issue.

2 participants