# 为帖子中的图片添加 ID 或 CLASS

**URL:** <https://meta.discourse.org/t/add-an-id-or-class-to-an-image-within-a-post/114740>\
**Category:** Product Support\
**Created:** [2019 年4 月 11 日 09:22 UTC](https://meta.discourse.org/t/add-an-id-or-class-to-an-image-within-a-post/114740 "2019-04-11T09:22:53Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

作者： ![DigitalStartup](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/digitalstartup/32/118242_2.png) [@DigitalStartup](https://meta.discourse.org/u/DigitalStartup)\
发布日期： [2019 年4 月 11 日 09:53 UTC](https://meta.discourse.org/t/add-an-id-or-class-to-an-image-within-a-post/114740/3 "2019-04-11T09:53:17Z")

</div>

So, it looks like the ID is being stripped out my DIV as well.

```plaintext
<div id="example">
    <a href="#">
        <img src="image.png" alt="image" width="690" height="85">
    </a>
</div>

```

This was the end goal I was attempting. Which is done. I just don’t want it to appear to logged in users, which is where I was relying on the CSS

 ![fw](https://global.discourse-cdn.com/meta/original/3X/2/4/24ba662f6fe707999f6ad6f2cec444e1cb367606.png)

---

_[View the full topic](https://meta.discourse.org/t/add-an-id-or-class-to-an-image-within-a-post/114740)._
