Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Floating images in Github Readme

How would I go about doing this? Putting the following code into the Markdown generator gives me the desired output

<div style="float: left"><img src="http://ompldr.org/vaDU5NQ/scrotter.png"/> </div> I'm trying not to, kid. Don't act so surprised, Your Highness. You weren't on any mercy mission this time. Several transmissions were beamed to this ship by Rebel spies. I want to know what happened to the plans they sent you. Kid, I've flown from one side of this galaxy to the other.  I've seen a lot of strange stuff, but I've never seen anything to make me believe there's one all-powerful Force controlling everything. 

However, adding this code to my README.md file makes it an inline image instead of floating.

How could I work around this? Is it a Github bug?

like image 403
yttrium Avatar asked Jan 20 '13 04:01

yttrium


People also ask

How do I put pictures side by side in readme?

Create a screenshot folder in your repository and add the images you want to display. Now go to README.md and add this HTML code to form a table. ** To get the image path --> Go to the screenshot folder and open the image and on the right most side, you will find Copy path button. Show activity on this post.

How do I align an image in GitHub readme?

So, that means to center or align images in GitHub readmes, your only solution is to use the deprecated HTML align attribute (that happens to still function), as this answer shows.

Can you add images in GitHub readme?

The trick is to add them to some comment — an issue, pull request or discussion — and then grab the resulting URL. You can drag and drop the image from your computer to a comment field in GitHub. Wait for the file to upload and then the URL to the image is right there!

Can you put pictures in readme?

README.md files are created using Markdown which you can use to format text and add images.


2 Answers

I know this thread's old, but for anyone interested, you can use <img align="left" src="img.jpg"> and <img align="right" src="img.jpg"> to float images on GitHub.

like image 148
Paul Shryock Avatar answered Oct 10 '22 19:10

Paul Shryock


I believe it is a security issue with GitHub. My understanding is they strip all HTML attributes such as style with the execption of perhaps href.

like image 43
Zombo Avatar answered Oct 10 '22 21:10

Zombo