Add images to README.md on GitHub

Recently I joined GitHub . I hosted some projects there.

I need to include some images in my README File. I don't know how to do that.

I searched about this, but all I got was some links which tell me to "host images on web and specify the image path in README.md file".

Is there any way to do this without hosting the images on any third-party web hosting services?


Try this markdown:

![alt text](http://url/to/img.png)

I think you can link directly to the raw version of an image if it's stored in your repository. ie

![alt text](https://raw.githubusercontent.com/username/projectname/branch/path/to/img.png)

Edit: just noticed comment linking to article which suggests using gh-pages. Also, relative links can be a better idea than the absolute URLs I posted above.


你也可以使用类似的相对路径

![Alt text](relative/path/to/img.jpg?raw=true "Title")

您可以创建新问题或PR,上传图片,复制图片网址,然后链接到您的md文件中的图片。

链接地址: http://www.djcxy.com/p/7858.html

上一篇: Git不显示untracked目录

下一篇: 将图像添加到GitHub上的README.md