# How to set height of image

**URL:** <https://forum.obsidian.md/t/how-to-set-height-of-image/90716>\
**Category:** Help\
**Created:** [October 30, 2024, 12:42pm UTC](https://forum.obsidian.md/t/how-to-set-height-of-image/90716 "2024-10-30T12:42:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Super](https://forum.obsidian.md/user_avatar/forum.obsidian.md/super/32/61265_2.png) [@Super](https://forum.obsidian.md/u/Super)\
**Post date:** [October 30, 2024, 12:42pm UTC](https://forum.obsidian.md/t/how-to-set-height-of-image/90716/1 "2024-10-30T12:42:09Z")

</div>

The official docs says:

> If you only specify the width, the image scales according to its original aspect ratio. For example, `![[Engelbart.jpg|100]]`.

What if I want to set the height only? My pictures are vertical not horizontal.

---

<div class="post-metadata">

**Author:** ![Yurcee](https://forum.obsidian.md/user_avatar/forum.obsidian.md/yurcee/32/53074_2.png) [@Yurcee](https://forum.obsidian.md/u/Yurcee)\
**Post date:** [October 30, 2024, 12:55pm UTC](https://forum.obsidian.md/t/how-to-set-height-of-image/90716/2 "2024-10-30T12:55:28Z")

</div>

You can set the width only. By reducing the width, the height will be reduced proportionally automatically.

---

<div class="post-metadata">

**Author:** ![Super](https://forum.obsidian.md/user_avatar/forum.obsidian.md/super/32/61265_2.png) [@Super](https://forum.obsidian.md/u/Super)\
**Post date:** [October 30, 2024, 2:30pm UTC](https://forum.obsidian.md/t/how-to-set-height-of-image/90716/3 "2024-10-30T14:30:03Z")

</div>

That is the problem.  
If you adjust the height based on the width you will not be able to set a specific height unless all your pictures are in a certain resolution.

---

<div class="post-metadata">

**Author:** ![DiCaver](https://forum.obsidian.md/user_avatar/forum.obsidian.md/dicaver/32/70059_2.png) [@DiCaver](https://forum.obsidian.md/u/DiCaver)\
**Post date:** [October 30, 2024, 2:45pm UTC](https://forum.obsidian.md/t/how-to-set-height-of-image/90716/4 "2024-10-30T14:45:41Z")

</div>

But per Obsidian documentation … [Embed files - Obsidian Help](https://help.obsidian.md/Linking+notes+and+files/Embed+files#Embed+an+image+in+a+note) … you can specify width and height …

```md
![[Engelbart.jpg|100x145]]

```

… but yes, you need to know or calculate new dimensions.

Cheers, Marko 🤓

---

<div class="post-metadata">

**Author:** ![anon45210282](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/a/d6d6ee/32.png) [@anon45210282](https://forum.obsidian.md/u/anon45210282)\
**Post date:** [October 30, 2024, 2:51pm UTC](https://forum.obsidian.md/t/how-to-set-height-of-image/90716/5 "2024-10-30T14:51:25Z")

</div>

Can the CSS in the link below be modified for your needs, or too restrictive?

> [@Set default size for images](https://forum.obsidian.md/t/set-default-size-for-images/68377/2):
>
> You can set default image sizes through CSS snippets. Go to Settings → Appearance, and then at the bottom of the pane is “CSS snippets”. You can click the folder to the right to open it, and put a text file there (mine is named “defaultimagesize.css”). The code in mine is this: /\* === Images size defaults === \*/ .image-embed.image-embed img:not([width]) { max-height: 250px; max-width: 300px; } You can adjust the values as you’d like from there. Then go back to the CSS snippets section…

---

<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 28, 2025, 2:52pm UTC](https://forum.obsidian.md/t/how-to-set-height-of-image/90716/6 "2025-01-28T14:52:18Z")

</div>

Closed on January 28, 2025, 2:52pm UTC

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