It's true that stackedit.io does not seem to support alignment, natively, as part of the markdown. It also looks like any style
attribute seems to get scrubbed out when being displayed, so float: left
and float: right
won't work. There seem to be some workarounds though.
You basically have to choose between using deprecated tags/attributes, or using classes defined by stackedit.io. It's not guaranteed that these classes won't be changed, in the future, though most of them are so standard that it's unlikely they would be.
Left and Right Aligned Images
As @imran-ali mentioned, you can use an img
align
tag:
<img align="left" src="https://www.gravatar.com/avatar/a6596d9955d2df59402c150f699bc8b8?s=32&d=identicon&r=PG&f=1" style="float:right"></img> Some text which should appear to the right of the image.
However, like the <center>
tag, the align
attributes have been deprecated in HTML5, and you should probably avoid using them.
You can also try to piggy-back off of some of the styles their markdown uses, since the class
attribute doesn't seem to get scrubbed.
<img class="pull-left" src="https://www.gravatar.com/avatar/a6596d9955d2df59402c150f699bc8b8?s=32&d=identicon&r=PG&f=1" style="float:right"></img> Some text which should appear to the right of the image.
If you want to align the image to the right, just swap align="left"
or class="pull-left"
with align="right"
or class="pull-right"
.
NOTE:
- The image still comes before the text, even if you want to align it to the right.
- The image needs to be on the same line as the text, in the markdown editor...otherwise it will put a line break between the image and the text.
Centered Images
The only two ways to do this, that I can figure out, aren't ideal. Again, you can piggy-back off of stackedit.io display css (the center-block class):
<img class="center-block" src="https://www.gravatar.com/avatar/a6596d9955d2df59402c150f699bc8b8?s=32&d=identicon&r=PG&f=1"></img>
Or you can use the <center>
tag, which, as previously mention, has been deprecated.