Using CSS3 attribute selectors to align images in Markdown

If you are looking to align images in a pure markdown (no HTML) document you can use CSS3 attribute selectors to select images with a certain anchors in its path.





img[src*='#right']{ float: right; }

This way with a few lines of css you can use valid markdown to control layout.

Justin Kelly

Justin Kelly

Web Developer, Business Analytics, Data Engineer specialising in PHP and Tableau

Based in Melbourne, Australia

Feel free to contact me or _justin_kelly

Leave a comment

Notify me of replies by email.