3

The default code to insert images into Stack Exchange is:

[![example image][1]][1]

  [1]: image-url

This creates an image link of the provided image, like:

example image

But if you change the code to the following, you get a normal image which is not an image link.

![example image][1]

  [1]: image-url

Example:

example image

So, what is the better way to insert images, and why do Stack Exchange sites insert image links instead of normal images?

2
  • meta.stackexchange.com/a/290397/270345
    – muru
    Feb 24, 2021 at 7:17
  • In case of these humongous images you posted you don't really need a linked version. But if you include for example a screenshot of a widescreen monitor this is really helpful as text quickly becomes to small on images that are shrunk to fit the narrow 1100px max width of the SE screens.
    – Luuklag
    Mar 16, 2021 at 15:37

1 Answer 1

14

There is no single correct way.

The one you mentioned is a good one and it's used most often (since the image uploader) produces it, but format used by the new editor is different:

[![enter image description here](image-url)](image-url)

Both methods have their advantages: the one you mentioned keeps all links organized in a nice 'table' at the bottom of the post (or paragraph) and you don't have to include the same link twice. On the other hand, for users not familiar with programming or copy editing on the Internet, it might be confusing: how does the system know which image to display? When you're writing an e-mail or a Word document, all (visible) information about the image is exactly where it appears in the post.

The advantage of using a link is mainly when it comes to large images. They can be clicked and zoomed (which is especially useful for mobile users). Also, it's possible to use a smaller version of the image in the post itself, so that it takes less time to load and doesn't take too much space.

Small image with a link to a larger image

Here is how the text in your post would look to do this (notice that the "1" link has m before the ".jpg" and the "1a" link doesn't. Adding text in quotes after a link will display the text in a tooltip when a mouse hovers over the link instead of clicking it.

[![Small image with a link to a larger image][1]][1a]

  [1]: https://i.stack.imgur.com/X6pf9m.jpg
  [1a]: https://i.stack.imgur.com/X6pf9.jpg "click for the full-size image"

When done right, it saves a lot of scrolling.

9
  • I’d say that even normal images can be opened in full screen by right-click => open in new tab. Why do we then need to have an image link in the post? Feb 24, 2021 at 8:52
  • To save a click @WebDevNoob.
    – Luuklag
    Feb 24, 2021 at 8:56
  • @WebDevNoob on touch screens, there is no click, let alone a right-click.
    – Glorfindel Mod
    Feb 24, 2021 at 8:57
  • Keeping clicked is considered right click on touch-screens Feb 24, 2021 at 8:58
  • @Luuklang Removal of some markdown vs saving one click! Which is better for the one who posts and also for SEO of SE sites? Feb 24, 2021 at 9:05
  • 4
    If you're constructing the image Markdown yourself, by all means feel free not to include the link. If you're using the uploader, why not leave it? That takes less effort from you and all visitors? You don't need to care about bandwidth, it's minimal compared to the actual image itself.
    – Glorfindel Mod
    Feb 24, 2021 at 9:07
  • 3
    @WebDevNoob You can't do what Glorfindel suggests (putting a smaller version in the post and a larger one in the link) if you don't link to it, so if you click on the image, you'll just get the small version in a bigger window (assuming people are making images smaller with imgur's URL size constraints).
    – Catija StaffMod
    Feb 24, 2021 at 14:42
  • @Catija I agree. But I just want to know why do we really need linked images... Feb 25, 2021 at 17:56
  • 3
    @WebDevNoob Here is an example of an answer of mine where I wanted small thumbnails in the answer, but I wanted people to be able to see a larger version of the image by clicking. Also, the image link can go anywhere, not just to another image - there's an example of that in this post I wrote on ELL's meta about working with images.
    – ColleenV
    Feb 25, 2021 at 18:16

You must log in to answer this question.

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