Skip to content

Unable to define width of image #140

Open
@adamjstewart

Description

@adamjstewart

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions