htmlcssmarkdown

Markdown and image alignment


I am making a site that publishes articles in issues each month. It is straightforward, and I think using a Markdown editor (like the WMD one here in Stack Overflow) would be perfect.

However, they do need the ability to have images right-aligned in a given paragraph.

I can't see a way to do that with the current system - is it possible?


Solution

  • You can embed HTML in Markdown, so you can do something like this:

    <img style="float: right;" src="whatever.jpg">
    
    OR
    
    <img style="display: block; margin: auto;" src="whatever.jpg"/>
    
    
    Continue markdown text...
    

    Example:

    <img style="float: right" src="https://cdn.sstatic.net/Img/unified/sprites.svg" alt="Sublime's custom image" />