# Set max height for image occlusion

**URL:** <https://forums.ankiweb.net/t/set-max-height-for-image-occlusion/45124>\
**Category:** Help\
**Created:** [May 21, 2024, 9:59pm UTC](https://forums.ankiweb.net/t/set-max-height-for-image-occlusion/45124 "2024-05-21T21:59:39Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fronk](https://avatars.discourse-cdn.com/v4/letter/f/9de0a6/32.png) [@Fronk](https://forums.ankiweb.net/u/Fronk)\
**Post date:** [May 21, 2024, 9:59pm UTC](https://forums.ankiweb.net/t/set-max-height-for-image-occlusion/45124/1 "2024-05-21T21:59:39Z")

</div>

I have a lot of IO cards that have a greater height than the screen and I’m trying to avoid scrolling for occlusions on the lower end the images. Is there a way to set a max height to 80-90% screen height? Thanks!

i.e.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/1/b/1b8d7313b0375e67544c8d8e49473c26905a7387.jpeg)

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [May 22, 2024, 10:12am UTC](https://forums.ankiweb.net/t/set-max-height-for-image-occlusion/45124/2 "2024-05-22T10:12:51Z")

</div>

It should already fit on the screen. Have you tried with the latest Anki?

---

<div class="post-metadata">

**Author:** ![Fronk](https://avatars.discourse-cdn.com/v4/letter/f/9de0a6/32.png) [@Fronk](https://forums.ankiweb.net/u/Fronk)\
**Post date:** [May 22, 2024, 6:26pm UTC](https://forums.ankiweb.net/t/set-max-height-for-image-occlusion/45124/3 "2024-05-22T18:26:16Z")

</div>

just updated but same problem is coming up, though to a lesser degree. Most of the image is showing but theres still a scroll bar. It would be ideal to set a max image height so I can show the remarks section. This card for example has acronyms that aren’t commonly used so i wrote the full name in the remarks section and I’m trying to get that to appear in the field of view

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [May 23, 2024, 10:15am UTC](https://forums.ankiweb.net/t/set-max-height-for-image-occlusion/45124/4 "2024-05-23T10:15:27Z")

</div>

You can try the following in your card template:

```auto
#image-occlusion-container {
    max-height: calc(90vh - 40px);
}

```

Adjust 90vh up or down to suit.

---

<div class="post-metadata">

**Author:** ![Fronk](https://avatars.discourse-cdn.com/v4/letter/f/9de0a6/32.png) [@Fronk](https://forums.ankiweb.net/u/Fronk)\
**Post date:** [May 30, 2024, 11:06pm UTC](https://forums.ankiweb.net/t/set-max-height-for-image-occlusion/45124/5 "2024-05-30T23:06:44Z")

</div>

under styling?

I tried and it didn’t change anything.

I’ve played around with the max height and widths a lot and I’ve found the max widths will work but changing anything on the max height doesn’t do anything on my end

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [June 1, 2024, 6:45am UTC](https://forums.ankiweb.net/t/set-max-height-for-image-occlusion/45124/6 "2024-06-01T06:45:36Z")

</div>

Works for me.

 ![Screenshot 2024-06-01 at 1.44.59 PM](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/6/a/6a999611d53713e139d31338745c896678894446.jpeg)

---

<div class="post-metadata">

**Author:** ![Fronk](https://avatars.discourse-cdn.com/v4/letter/f/9de0a6/32.png) [@Fronk](https://forums.ankiweb.net/u/Fronk)\
**Post date:** [June 10, 2024, 7:38pm UTC](https://forums.ankiweb.net/t/set-max-height-for-image-occlusion/45124/7 "2024-06-10T19:38:57Z")

</div>

interesting, mine has a lot more text in my styling section - all of this is way beyond me:

```auto
/* GENERAL CARD STYLE */
.card {
  font-family: "Helvetica LT Std", Helvetica, Arial, Sans;
  font-size: 150%;
  text-align: center;
  color: black;
  background-color: white;
}

/* OCCLUSION CSS START - don't edit this */
#io-overlay {
  position:absolute;
  top:0;
  width:100%;
  z-index:3
}

#io-original {
  position:relative;
  top:0;
  width:100%;
  z-index:2;
  visibility: hidden;
}

#io-wrapper {
  position:relative;
  width: 100%;
}
/* OCCLUSION CSS END */

/* OTHER STYLES */
#io-header{
  font-size: 1.1em;
  margin-bottom: 0.2em;
}

#io-footer{
  max-width: 80%;
  margin-left: auto;
  margin-right: auto;
  margin-top: 0.8em;
  font-style: italic;
}

#io-extra-wrapper{
  /* the wrapper is needed to center the
  left-aligned blocks below it */
  width: 80%;
  margin-left: auto;
  margin-right: auto;
  margin-top: 0.5em;
}

#io-extra{
  text-align:center;
  display: inline-block;
}

.io-extra-entry{
  margin-top: 0.8em;
  font-size: 0.9em;
  text-align:left;
}

.io-field-descr{
  margin-bottom: 0.2em;
  font-weight: bold;
  font-size: 1em;
}

#io-revl-btn {
  font-size: 0.5em;
}

.mobile .card, .mobile #content {
  font-size: 120%;
  margin: 0;
}

.mobile #io-extra-wrapper {
  width: 95%;
}

.mobile #io-revl-btn {
  font-size: 0.8em;
}

```

---

<div class="post-metadata">

**Author:** ![sorata](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/sorata/32/34115_2.png) [@sorata](https://forums.ankiweb.net/u/sorata)\
**Post date:** [June 11, 2024, 3:39pm UTC](https://forums.ankiweb.net/t/set-max-height-for-image-occlusion/45124/8 "2024-06-11T15:39:39Z")

</div>

If I’m not wrong, this is the note type called IO Enhanced. I think it’s back from the IO add on days. It has a lot of extra fields and such.

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [June 18, 2024, 6:29am UTC](https://forums.ankiweb.net/t/set-max-height-for-image-occlusion/45124/9 "2024-06-18T06:29:24Z")

</div>

My suggestion above assumes you’re using the standard Anki “Image Occlusion” notetype. If you’re using one from an add-on, you’ll need to post in the add-on’s support thread.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [July 18, 2024, 6:29am UTC](https://forums.ankiweb.net/t/set-max-height-for-image-occlusion/45124/10 "2024-07-18T06:29:39Z")

</div>

Closed on July 18, 2024, 6:29am UTC

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