Set max height for image occlusion

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.

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

1 Like

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

1 Like

You can try the following in your card template:

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

Adjust 90vh up or down to suit.

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

Works for me.

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

/* 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;
}

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.

3 Likes

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.

1 Like

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