# The P tag that holds the IMG tag needs a unique class

**URL:** <https://talk.commonmark.org/t/the-p-tag-that-holds-the-img-tag-needs-a-unique-class/3320>\
**Category:** Extensions\
**Created:** [January 8, 2020, 5:53pm UTC](https://talk.commonmark.org/t/the-p-tag-that-holds-the-img-tag-needs-a-unique-class/3320 "2020-01-08T17:53:23Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![chrisalley](https://cdn.commonmark.org/user_avatar/talk.commonmark.org/chrisalley/32/906_2.png) [@chrisalley](https://talk.commonmark.org/u/chrisalley)\
**Post date:** [January 8, 2020, 6:21pm UTC](https://talk.commonmark.org/t/the-p-tag-that-holds-the-img-tag-needs-a-unique-class/3320/2 "2020-01-08T18:21:42Z")

</div>

There was some discussion about adding optional classes via a [consistent attribute syntax](https://talk.commonmark.org/t/consistent-attribute-syntax/272).

However, the HTML version is totally fine as well. It’s more long winded, but it it will work with every CommonMark implementation.

I don’t think the spec should include a default class because that could clash with other classes on the page. But perhaps your specific renderer could add a class in a post processing step. Another option would be to add a CSS rule to add particular styling to all p tags within the div that contains the contents of the Markdown document.

---

_[View the full topic](https://talk.commonmark.org/t/the-p-tag-that-holds-the-img-tag-needs-a-unique-class/3320)._
