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

Unable to define width of image #140

Open
adamjstewart opened this issue Aug 25, 2021 · 0 comments
Open

Unable to define width of image #140

adamjstewart opened this issue Aug 25, 2021 · 0 comments

Comments

@adamjstewart
Copy link

I'm using pytorch_sphinx_theme for a PyTorch domain library I'm developing. When I try to add a link to an external SVG image (like a badge) it seems that I'm unable to control the width of the image. For example:

.. image:: https://colab.research.google.com/assets/colab-badge.svg
   :width: 200

When I build this, no matter what width I specify, it is always 100%. The HTML is being rendered correctly:

<a class="reference internal image-reference" href="https://colab.research.google.com/assets/colab-badge.svg"><img alt="https://colab.research.google.com/assets/colab-badge.svg" src="https://colab.research.google.com/assets/colab-badge.svg" width="200" /></a>

but because of these lines of CSS:

article.pytorch-article img {
  width: 100%;
}

the width is being overridden. If I remove that section from the CSS it behaves as expected.

Is this section actually needed for something, or should I submit a PR to remove it?

P.S. @calebrob6 is the one who actually found the offending lines of CSS.

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.

1 participant