0

The Markdown help text says that it's possible to embed images using an HTML <img src="..."> construct. The definitive guide (search for img) also seems imply that percentages are permitted.

This doesn't work for me.

Here is an embedded image:

↑ Or rather, it's not.

Here is the instruction: <img src="https://i.stack.imgur.com/lP6tZ.png" width="20%" height="20%">

  • Why do you think the definitive guide seems to imply percentages are permitted? All it says is that the width and height can be up to 999, and that the mobile site has a max-width of 99%. Why do you need this, anyway? – muru Nov 15 '17 at 10:53
  • @muru It's not definite, but the preceding paragraph states that, "The following attributes are allowed on the <img> tag, but note that the mobile theme enforces a maximum width of 90%...". Why do I want it? I have a high resolution screenshot from my mobile phone and I wanted to constrain the rendered view to 30% while leaving the image intact in case someone needed the detail. – roaima Nov 15 '17 at 11:13
  • i.e., there's a max-width: 90% in the mobile CSS. (typo in my first comment) I don't see how that translates to % being allowed in these attributes. It even says hat the px isn't allowed, so I'd think they have a pretty strict filter there. – muru Nov 15 '17 at 11:16
4

I have a high resolution screenshot from my mobile phone and I wanted to constrain the rendered view to 30% while leaving the image intact in case someone needed the detail.

Then height and width are the wrong way to go about it, since the user still has to download the large image anyway. What you should use is imgur's built-in thumbnailing facilities. For a given image https://i.stack.imgur.com/lP6tZ.png, you can get thumbnails of various sizes by tacking on an l, m, or s before the extension:

Then you can set a link on the image to the original:

[![](https://i.stack.imgur.com/lP6tZm.png)](https://i.stack.imgur.com/lP6tZ.png)

An example of this: one of my Meta SE posts

A list of possible options, from this blog post:

  • s = Small Square (90×90)
  • b = Big Square (160×160)
  • t = Small Thumbnail (160×160)
  • m = Medium Thumbnail (320×320)
  • l = Large Thumbnail (640×640)
  • h = Huge Thumbnail (1024×1024)
  • This is fantastic, thank you. I had no idea. When you write, "What you should use is imgur's built-in thumbnailing facilities", how was I supposed to know even to look for this feature? There's nothing in the obviously available help text, nothing on the "Insert an image by drag'n'drop « here »" overlay. Does this then generate a new question as an enhancement request to provide information about Imgur's thumbnailing features? – roaima Nov 15 '17 at 12:21
  • @roaima adding that to the docs somewhere would be a worthy feature request. – muru Nov 15 '17 at 12:24
  • Thank you. unix.meta.stackexchange.com/q/4670/100397 – roaima Nov 15 '17 at 12:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .