# How to add paddings in my body text?

**URL:** <https://forum.obsidian.md/t/how-to-add-paddings-in-my-body-text/75292>\
**Category:** Devs: Theme Design & Custom CSS\
**Tags:** custom-css\
**Created:** [January 19, 2024, 6:34pm UTC](https://forum.obsidian.md/t/how-to-add-paddings-in-my-body-text/75292 "2024-01-19T18:34:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![buigui](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/b/b782af/32.png) [@buigui](https://forum.obsidian.md/u/buigui)\
**Post date:** [January 19, 2024, 6:34pm UTC](https://forum.obsidian.md/t/how-to-add-paddings-in-my-body-text/75292/1 "2024-01-19T18:34:33Z")

</div>

First, search the [help docs](https://help.obsidian.md) and this forum. Maybe your question has been answered! The [debugging steps](https://forum.obsidian.md/t/about-the-bug-reports-category/24/11) can help, too. Still stuck? Delete this line and proceed.

### What I’m trying to do

I would kike to add a 5px top and bottom padding to my body text

### Things I have tried

In my obsidian.css file, I have tried codes such as :

```auto
.cm-s-obsidian {
padding-top: 5px;
padding-bottom: 5px
}

```

or

```auto
.cm-s-obsidian {
padding: 5px 0 5px 0;
}

```

Both above codes don’t work.  
Yet below code works :

```auto
.cm-s-obsidian {
font-size: 18px;
			}

```

Does anyone understand why or how I could make it ?  
Thank you

 ![Capture d’écran 2024-01-19 à 18.35.25](https://forum.obsidian.md/uploads/default/original/3X/9/8/989bd6214c9fca0e976097a86f85cce69ed2fe6f.png)

---

<div class="post-metadata">

**Author:** ![ariehen](https://forum.obsidian.md/user_avatar/forum.obsidian.md/ariehen/32/46932_2.png) [@ariehen](https://forum.obsidian.md/u/ariehen)\
**Post date:** [January 20, 2024, 12:27am UTC](https://forum.obsidian.md/t/how-to-add-paddings-in-my-body-text/75292/2 "2024-01-20T00:27:48Z")

</div>

I think you may be looking for `.cm-line` in the editor (_source mode_ and _Live Preview_). Have a look here to see if it seems similar: [Can't get custom CSS to work - #15 by adrienneteicher](https://forum.obsidian.md/t/cant-get-custom-css-to-work/58404/15)

_Live Preview_ with the adjustment:

 ![Screenshot 2024-01-20 at 9.07.44](https://forum.obsidian.md/uploads/default/original/3X/7/1/717baeb0048b245b17dccaba9547fd7243b1017d.png)

Adjusting `.cm-line` will affect spacing in lists, code blocks, and callouts as well, so you may want to exclude those.

Adding a part to take care of _Reading view_ (the top section), you could try something like this to see if it works:

```css
.markdown-preview-view br {
    content: '';
    display: block;
    margin-block: 5px;
}

.markdown-source-view .cm-line:not(.HyperMD-list-line, .HyperMD-codeblock, .HyperMD-callout) {
    padding-block: 5px;
}

```

_Live Preview_ before:

![Screenshot 2024-01-20 at 9.21.10](https://forum.obsidian.md/uploads/default/original/3X/9/4/9481c6780711e892ea356321117433f70f81b396.png)

_Live Preview_ after:

![Screenshot 2024-01-20 at 9.20.49](https://forum.obsidian.md/uploads/default/original/3X/e/e/ee37be6c24aaa85cb38d2f4b140991902f083a89.png)

---

<div class="post-metadata">

**Author:** ![buigui](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/b/b782af/32.png) [@buigui](https://forum.obsidian.md/u/buigui)\
**Post date:** [January 20, 2024, 9:29am UTC](https://forum.obsidian.md/t/how-to-add-paddings-in-my-body-text/75292/3 "2024-01-20T09:29:20Z")

</div>

> [@ariehen](#):
>
> ```auto
> .markdown-preview-view br {
> content: '';
> display: block;
> margin-block: 5px;
> }
> 
> .markdown-source-view .cm-line:not(.HyperMD-list-line, .HyperMD-codeblock, .HyperMD-callout) {
> padding-block: 5px;
> }
> 
> ```

Great, it works and helped me a lot.  
Thank you so much 🙂

---

<div class="post-metadata">

**Author:** ![system](https://forum.obsidian.md/uploads/default/original/3X/b/e/bec35fbd23ab28909bb6bfe62cb32eb82dd34019.png) [@system](https://forum.obsidian.md/u/system)\
**Post date:** [January 27, 2024, 3:16pm UTC](https://forum.obsidian.md/t/how-to-add-paddings-in-my-body-text/75292/5 "2024-01-27T15:16:47Z")

</div>

Closed on January 27, 2024, 3:16pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
