# 为图片添加边框

**URL:** https://meta.discourse.org/t/add-border-to-image/363471
**Category:** Support
**Created:** [2025年四月25日 15:15 UTC](https://meta.discourse.org/t/add-border-to-image/363471 "2025-04-25T15:15:38Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![robbie.morrison](https://avatars.discourse-cdn.com/v4/letter/r/c5a1d2/32.png) [@robbie.morrison](https://meta.discourse.org/u/robbie.morrison)
#### Post date: [2025年四月25日 15:15 UTC](https://meta.discourse.org/t/add-border-to-image/363471/1 "2025-04-25T15:15:38Z")

</div>

大家好

我可以在不使用主题组件的情况下为 **JPG 图片** 添加一个 **细边框** 吗？我想保持简单，避免使用这个组件：

> [@Rounded Borders for images, oneboxes, blockquotes & more](https://meta.discourse.org/t/rounded-borders-for-images-oneboxes-blockquotes-more/232044):
>
> Created a very simple component to change the borders of images, oneboxes, blockquotes and staff notices shown in topics. Allows change of the following settings set image rounding intensity set image border width set image border color set onebox rounding intensity change onebox border width change onebox border color change onebox background color set rounding blockquotes intensity remove left border from blockquotes set ‘staff color’ rounding intensity [topic thumbnail](https://meta.discourse.org/t/topic-list-thumbnails-theme-component/150602) support for: list ro…

我已经尝试了我能想到的所有 `img` 标签的变体。唯一有效的方法是将图片嵌入 `kbd` 标签中，但这有点奇怪。这实际上是我想要写的：

```html
<img src="upload://jIMXtLgb7enbLUiahXVT1Jz14n4.jpeg"
  alt="显示废弃的中压电线杆的照片"
  width="75%"
  style="border: 1px solid gray">

```

这是通过标准上传的示例图片：

 ![图片显示一个古老、生锈的电力塔，带有绝缘子和电气设备。（由 AI 题注）](https://global.discourse-cdn.com/meta/original/4X/8/a/3/8a3971181bca25f5d4653b2611097f4d2f8e68ee.jpeg)

我必须说，AI 图片字幕做得相当好。提前感谢！

---

_[View the full topic](https://meta.discourse.org/t/add-border-to-image/363471)._
