Viewing images in Marked

kirkmc's Avatar

kirkmc

Jan 29, 2014 @ 01:49 PM

I write articles which contain screenshots. I'd like to be able to preview the articles with images, but there are problems with retina images being too large. I know I can add a width= parameter to image links in the Markdown code, but I don't want to do that; I need to submit articles without extraneous code. Is there any way to set all images to be scaled; say, 1/2 or 1/4 of their full size? I'm not sure what CSS would do this.

  1. Support Staff 1 Posted by Brett on Jan 29, 2014 @ 03:28 PM

    Brett's Avatar

    You can do it fairly easily, either in the global CSS field in Style
    preferences, or in a custom stylesheet. If your images are always going
    to be double-size, use:

    #wrapper img {
    width: 50%;
    height: auto;
    }

    If you just want to make sure they always fit on the page, you can use
    max-width:

    #wrapper img {
    max-width: 100%;
    height: auto;
    }

    Let me know if that helps.

    -Brett

  2. 2 Posted by kirkmc on Jan 29, 2014 @ 03:53 PM

    kirkmc's Avatar

    Brett,

    That’s great. The second option is best, because some of my articles have a combination of retina and non-retina images.

    Best,

    Kirk

Reply to this discussion

Internal reply

        Formatting help / Preview (switch to plain text)

          You can attach files up to 10MB

            If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

              Keyboard shortcuts

              Generic

              ? Show this help
              ESC Blurs the current field

              Comment Form

              r Focus the comment reply box
              ^ + ↩ Submit the comment

              You can use Command ⌘ instead of Control ^ on Mac