Ever since the Imgur resizing stopped working, I've been struggling with changing the display size of an image embedded in an answer. I finally figured out it was because I was specifying the width or height attribute after the alt attribute.

This is easy enough to work around, but it may be a symptom of a larger problem with the parsing of embedded HTML, so I decided to report it (and subsequently found out that it is documented to work that way). Because it's a known limitation, I think that the Markdown Editing Help should be updated so that someone else doesn't go through the same struggle I did trying to figure out why it works in one place and not another. The "advanced help" for images accessible through the (?) at the top right of the edit box is:

You can also use standard HTML image syntax, which allows you to scale the width and height of the image.

<img src="http://example.com/sample.png" width="100" height="100">

URLs can be relative or full.

As rene pointed out in a comment, there is documentation titled "What HTML tags are allowed on Stack Exchange sites?" that explains the attribute order but that link isn't easily discoverable in the Markdown help if you're focused on just the img tag, which you've already seen is a valid tag from the documentation.

There is a demonstration in the ELL formatting sandbox, that I'll reproduce here:

When the resizing doesn't work, or if you want to choose a size other than the standard sizes, you can use HTML and still link to the full sized image:

[<img src="http://i.stack.imgur.com/SpjyG.jpg" width="200" alt="My cat Loki"/>][Loki]
[Loki]: https://i.stack.imgur.com/SpjyG.jpg

My cat Loki

Be sure to put your width and height tags before the "alt" tag or your image may not be displayed:

[<img src="http://i.stack.imgur.com/SpjyG.jpg" alt="My cat Loki" width="200"/>][Loki]

  • 1
    Hmm, that info is mentioned in What HTML tags are allowed on Stack Exchange sites? – rene Sep 26 '18 at 15:00
  • @rene Thanks for making me aware of that - the link to that guidance is buried in the HTML section of the advanced markup help, not in the image section where I was looking and where I think other folks are likely to look. – ColleenV Sep 26 '18 at 15:09
  • I always come back here to remember how to edit images. My thick brain just doesn't get it, the symbols are meaningless to me, but the formula works each and every time. I wish I could upvote more than once. – Mari-Lou A Oct 23 '18 at 6:05

You must log in to answer this question.

Browse other questions tagged .