--- title: Attribute Support icon: ic:outline-data-object createTime: 2025/11/30 18:02:41 permalink: /en/guide/markdown/attrs/ --- ## Overview Add classes, identifiers, and attributes to your Markdown. **This feature is enabled by default.** ## Syntax Use `{ }` after Markdown tokens to add class names, identifiers, or attributes. ```md markdown content{.classname #id attr1=value attr2="value with spaces"} ``` ### `.classname` Start with `.` to add a class. **Input:** ```md __bold__{.bolder} ``` **Output:** ```html bold ``` ### `#id` Start with `#` to add an ID. **Input:** ```md ## Heading{#header-1} ``` **Output:** ```html

Heading

``` :::tip This is commonly used for customizing anchor links for headings. ::: ### `attr=value` **Input:** ```md [link](https://example.com){target=_blank} [link](https://example.com){rel="noopener noreferrer"} ``` **Output:** ```html link link ``` ### Combined Usage **Input:** ```md [link](https://example.com){.link #linkId target=_blank rel="noopener noreferrer"} ``` **Output:** ```html link ``` ### On Block-Level Tokens Add attributes on the next line after block-level tokens. For example, using with an unordered list: **Input:** ```md - list item **bold** {.red} ``` **Output:** ```html ``` For example, using with a table: **Input:** ```md | header1 | header2 | | ------- | ------- | | column1 | column2 | {.special} ``` **Output:** ```html
header1 header2
column1 column2
``` Table cells can also use attributes, commonly for cell merging: **Input:** ```md | A | B | C | D | | ----------------------- | --- | --- | ---------------- | | 1 | 11 | 111 | 1111 {rowspan=3} | | 2 {colspan=2 rowspan=2} | 22 | 222 | 2222 | | 3 | 33 | 333 | 3333 | ``` **Output:** ```html
A B C D
1 11 111 1111
2 22
3
``` **Result:** | A | B | C | D | | ----------------------- | --- | --- | ---------------- | | 1 | 11 | 111 | 1111 {rowspan=3} | | 2 {colspan=2 rowspan=2} | 22 | 222 | 2222 | | 3 | 33 | 333 | 3333 |