Reputation: 121
To explain the process that is going on in my notebook code, I use markdown text boxes between snippets of code. I would like to use small images to illustrate the text (a diagram often makes text clearer).
I cannot find a way of having those images floating on the right however. I tried adding tags with CSS styling, but Colab seems to be removing those. I tried wrapping things in , but again no luck there.
Upvotes: 4
Views: 4675
Reputation: 41
You can also use the now deprecated align attribute on the image tag. https://html.com/attributes/img-align/
Upvotes: 2
Reputation: 86330
One option is to use an HTML cell with the code hidden, which is triggered by the presence of a form title. For example, create a code cell with this content:
#@title Some Stuff
%%html
Here are some words.
<img src="https://www.w3schools.com/html/smiley.gif"
style="float:right;width:50px;height:50px;">
Here are some other words and there is an image floating around it.
Then execute the cell & double click on the rendered title to hide the source. The result looks like this:
Upvotes: 1