Markdown Images
Images make documents more vivid and easier to understand.
Markdown's image syntax is concise and flexible.
The Markdown image syntax format is as follows:


- Start with an exclamation mark !
- Then a pair of square brackets containing the image's alt text
- Then a pair of parentheses containing the image URL, and optionally a quoted 'title' attribute text at the end.
Relative path example:



Absolute path example:


Path usage suggestions:
- Relative paths are recommended for easier project portability
- It is recommended to create a dedicated image folder (such as images/ or assets/)
- Use meaningful file names for easier management
- Pay attention to path separator differences across operating systems
Reference web images directly:


The display result is as follows:

Of course, you can also use variables for the image URL just like with web addresses:
这个链接用 1 作为网址变量 [RUNOOB][1].
然后在文档的结尾为变量赋值(网址)
[1]: https://static.jyshare.com/images/runoob-logo.png
The display result is as follows:

Markdown still cannot specify image height and width; if you need to, you can use plain tag.
The display result is as follows:

Use a CDN service:


Notes on web images:
- Ensure the image URL is stable and accessible
- Pay attention to image copyright issues
- Consider loading speed and network conditions
- It is recommended to back up important images locally
The importance of image alt text
Alt text provides alternative information when an image cannot be displayed, and is also important for accessibility and SEO:
Good alt text examples:



Alt text to avoid:
 // 太简单,没有描述性
 // 完全没有 alt 文本
 // 不描述图片内容
Alt text best practices:
- Concise but descriptive
- Describe the main content and purpose of the image
- Avoid redundant words like "image" or "photo"
- For decorative images, you can use empty alt text
- Consider context and provide meaningful information
Image size control (HTML method)
Standard Markdown does not support directly controlling image size, but you can use HTML tags.
Use the HTML img tag:
Responsive images:
Image alignment:
Advanced usage of links and images
Image-link combinations
Make the image a clickable element of a link.
Basic syntax:
[](链接URL)
Practical example:
[](https://github.com/username/project)
[](https://example.com "点击访问官网")
Common use cases:
[](https://travis-ci.org/user/repo)
[](https://opensource.org/licenses/MIT)
[](https://apps.apple.com/app/your-app)
[](https://play.google.com/store/apps/details?id=com.yourapp)
Relative and Absolute Paths
Advantages of relative paths:
project/
├── README.md
├── docs/
│ ├── guide.md
│ └── images/
│ └── screenshot.png
└── assets/
└── logo.png



Path planning suggestions:
- Create a unified assets folder in the project root
- Use descriptive folder names
- Keep the path structure consistent
- Consider the path rules of static site generators
Image centering and alignment
Method 1: HTML + CSS
** Method 2: Use HTML alignment attributes **
** Method 3: Create an image gallery **
Useful image display templates:
## 产品展示
### Main Features
智能识别
AI驱动的图像识别技术
快速处理
毫秒级响应速度
### 界面预览
| 移动端 | 桌面端 |
|:---:|:---:|
|  |  |
| 响应式设计,完美适配 | 大屏体验,功能齐全 |
Performance optimization suggestions:
- Optimize image size and format (WebP > PNG > JPG)
- Use appropriate image sizes; avoid scaling large images on the page
- Consider using image compression tools
- Prepare different-sized images for different devices
Troubleshooting links and images
Common problems and solutions:
- Link not clickable: check the syntax format and ensure brackets are correctly paired
- Image not displaying: verify the image path and file existence
- Image too large: use HTML to control size or optimize the image file
- Link opens in a new window: use HTML tag
Debugging tips:
测试链接:[点击测试](https://httpbin.org/get)

By mastering the various uses of links and images, you can create Markdown documents with rich content and clear navigation. These skills are very important for writing technical documentation, project descriptions, and online content.