How To Wrap Text Around Images In Steemit

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@nickdavison·
0.000 HBD
How To Wrap Text Around Images In Steemit
<p>Steemit's post editor is relatively straight forward to use, the styling guide link at the top right of the main text area even provides us with some handy instructions on how to format headers, lists, and tables using Markdown.</p>

<h4>What is Markdown?</h4>

<p>Markdown is a text to HMTL conversion syntax, that converts text to structured HTML, the standard language used to create webpages.</p>

<h4>Limitations of Markdown</h4>
<p>Because  Markdown concerns itself with coverting text to structured HTML, and not with webpage layout, it is not possible to use Markdown to wrap text around images.</p>

<h4>HTML To The Rescue</h4>
<p>Instead, to achieve this layout we need to do two things:</p>

<ol>
<li>Use HTML to embed the image.</li>
<li>Wrap the image in an element to float it left or right on the page.</li>
</ol>

<h4>Lets get started:</h4>

<p>First drag an image into your post editor, you should end up with a string of code that looks something like this:</p>

<p><code>![steemit-logo.png](https://steemitimages.com/DQmdEC/steemit-logo.png)</code></p>

<p>Great, now that your image is hosted on Steemit's server, lets change that code and use HTML to embed the image rather than Markdown:</p>

<ol>
<li>Remove <code>![steemit-logo.png](</code> from before the image URL.</li>
<li>Remove <code>)</code> from after the image URL.</li>
<li>Add <code>&lt;img src="</code> before the image URL.</li>
<li>Add <code>" /&gt;</code> after the image URL.</li>
</ol>

<p>Our image embed code should now look like this:</p>
<p><code>&lt;img src="https://steemitimages.com/DQmdEC/steemit-logo.png" /&gt;</code></p>

<p>Your image should now be visible in the post preview section, but we still need to apply a CSS class to the image to align it left or right, and allow text to fill the empty space around the image. To do this we wrap the image in a div, and give that div a class which references a predefined style in Steemit's CSS style Sheet.</p>

<table>
<tr>
<td><strong>CSS Classes</strong></td>
<td>&nbsp;</td>
</tr>
<tr>
<td>To align images left, use:</td>
<td>pull-left</td>
</tr>
<tr>
<td>To align images right, use:</td>
<td>pull-right</td>
</tr>
<hr>
</table>
<hr>

<p>Lets assume we want the image on the right side of our post, to achieve this we would add:</p>

<p><code>&lt;div class="pull-right"&gt;</code></p>

<p>To the beginning of our image embed code, then we would add:</p>

<p><code>&lt;/div&gt;</code></p>

<p>To the end of our image embed code, the final embed code should look like this:</p>

<p><code>&lt;div class="pull-right"&gt;&lt;img src="https://steemitimages.com/DQmdEC/steemit-logo.png" /&gt;&lt;/div&gt;</code></p>

<hr>
<div class="pull-right"><img src="https://steemitimages.com/DQmfEAMRGZnT75jfNoGKcs27N58dnJCW4fYE7z5NHAqs2Ks/steemit-logo.png" /></div><p>Awesome! Now our image is aligned to the right hand side of the page, and our text (which is typed after the image embed code) wraps nicely around it to fill the empty space!</p>

<p>I normally resize my images before uploading them if I am going to use this layout technique. Giving them a width of 390 pixels seems to work well.</p>

<p>You can float images alternately left and right to achieve a grid style layout, though if you do not add enough text to each section your images may overlap, breaking the layout. If this happens try using:</p>

<p><code>&lt;div class="clear"&gt;&lt;/div&gt;</code> before the embed code for each image.</p>

<hr>
<div class="pull-left"><img src="https://image.ibb.co/dwumtQ/roundmask_sig_photo.jpg" alt="roundmask_sig_photo" border="0"></div>
<em><a href="https://steemit.com/@nickdavison">Nick Davison</a> is a creative marketer and <a href="http://www.rankagility.com/">business owner</a> who loves to write about a range of topics including food, nature, and crypto currencies.</em> 
<p></p>
<center>
<a href="http://steemitboard.com/board.html?user=nickdavison"><img src="https://image.ibb.co/i0W5nk/comments.png" alt="comments" border="0"></a><a href="http://steemitboard.com/board.html?user=nickdavison"><img src="https://image.ibb.co/hDS0L5/votes.png" alt="votes" border="0"></a><a href="http://steemitboard.com/board.html?user=nickdavison"><img src="https://image.ibb.co/iPRGtQ/payout.png" alt="payout" border="0"></a><a href="http://steemitboard.com/board.html?user=nickdavison"><img src="https://image.ibb.co/iK2BSk/level.png" alt="level" border="0"></a><a href="http://steemitboard.com/board.html?user=nickdavison"><img src="https://image.ibb.co/f5NpDQ/voted.png" alt="voted" border="0"></a><a href="http://steemitboard.com/board.html?user=nickdavison"><img src="https://image.ibb.co/nHgS05/commented.png" alt="commented" border="0"></a><a href="http://steemitboard.com/board.html?user=nickdavison"><img src="https://image.ibb.co/f02NYQ/firstvoted.png" alt="firstvoted" border="0"></a>
<div class="clear"></div>
<p><p>
<img src="https://steemitimages.com/DQmcVxXrpP7qih5FAxSiX3ga23MuTC52KK7jA6YwJujuVBZ/upvote-resteem-comment-follow.gif" />
<hr>
</center>
👍 , , , , , , , , , , , , , , , , , , , , , , ,