# Specify the width of an image by percentage

**URL:** <https://forum.literatureandlatte.com/t/specify-the-width-of-an-image-by-percentage/155101>\
**Category:** Scrivener\
**Tags:** support, compile, ebooks\
**Created:** [November 19, 2026, 11:33am UTC](https://forum.literatureandlatte.com/t/specify-the-width-of-an-image-by-percentage/155101 "2026-11-19T11:33:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ldecher](https://forum.literatureandlatte.com/user_avatar/forum.literatureandlatte.com/ldecher/32/23709_2.png) [@ldecher](https://forum.literatureandlatte.com/u/ldecher)\
**Post date:** [November 19, 2026, 11:33am UTC](https://forum.literatureandlatte.com/t/specify-the-width-of-an-image-by-percentage/155101/1 "2026-11-19T11:33:23Z")

</div>

Hi, AmberV,

Can Scrivener specify image dimensions with em units? I’m finishing off the details for creating an accessible epub in Scrivener (Mac OS) and I’d like the images to look okay on various size devices.

I tried (repeatedly) to use Scrivener’s ebook=50% option in the image tag, but haven’t gotten it to work. Does the ebook=% option use percentages in the outputted epub?

Since I am using your “Figure” examples to add my alt text, I could add a width=“50%” to the Raw HTML for my chapter header images. I used Styles in the compile to make the meaning of italics clear and specify foreign language words, etc. Overall, I think I’ve covered most issues for the present.

Here’s what I used in the prefix for the chapter header works perfectly on Amazon and B&N, but Draft2Digital validator says Apple and many other stores will reject width=“50%” and wants an integer only.

```nohighlight

<figure><img src="images/750-300DPI-Chapter-headers-Queen-Castle-PARSNIPS-7DEC2025JPG.jpg" alt="decorative header"width="100%" id="<$img:750-300DPI-Chapter-headers-Queen-Castle-PARSNIPS-7DEC2025JPG>" />
</figure>

```

Note: I still have to delete extra characters in Sigil after the compile, but they are always the same couple search and replaces, so I don’t have to think about what to delete.

My understanding is that accessible images should have sizes that are expressed in relative terms, but if % gets thrown out, I don’t know how else to do that. I read that there are other options in CSS, but that some ereaders will throw out the CSS if they don’t like it. Maybe I need to re-visit this challenge in a few years. . .

Regards,

Laurel

---

<div class="post-metadata">

**Author:** ![AmberV](https://forum.literatureandlatte.com/user_avatar/forum.literatureandlatte.com/amberv/32/13021_2.png) [@AmberV](https://forum.literatureandlatte.com/u/AmberV)\
**Post date:** [November 19, 2026, 12:25pm UTC](https://forum.literatureandlatte.com/t/specify-the-width-of-an-image-by-percentage/155101/2 "2026-11-19T12:25:44Z")

</div>

I haven’t looked into it, but my guess would be that they aren’t liking the use of percentages in the image width attribute itself, not that they do not want percentages to ever be used to describe the size of anything. At least I’ve never heard of using percentages causing problems when sizing elements in an ebook, images included, but meanwhile [using anything other than pixels in this attribute is technically invalid](https://www.w3schools.com/tags/att_img_width.asp).

Or to put it another way, it isn’t throwing your CSS out—you aren’t using CSS. Proper formatting would look like one of:

```html
<img style="width: 50%;" ... />

```

Or in the CSS compile format pane:

```css
img { width: 50%; }

```

The latter is preferable if this is a universal design decision. Ideally I’d say the former is rarely ever preferable. If you have a subset of images that should display this way, then this is better:

```html
<img class="portraits" ... />

```

```css
.portraits { width: 50%; }

```

The key concept here is that you are describing the image by its kind, a portrait in a biography for instance, and then elsewhere you are deciding what portraits should look like. Instead of brute forcing formatting into the image itself based on some unnamed reason, you have a clear statement of purpose and execution of it in design.

I would also consider putting the CSS on the \<figure\> instead of the image by itself, if you use captions. That way the caption will be scaled to the image width as well.

The “em” unit is not what you want here. It is indeed percentage based (though expressed as a floating point), but based off of the current font size in the scope rather than the container size. I.e. width: 16em will change depending on whether it is used within a heading or fine print, and width: 50% will change if the physical size of the box the element is within changes (e.g. rotating the screen from portrait to landscape).

---

<div class="post-metadata">

**Author:** ![ldecher](https://forum.literatureandlatte.com/user_avatar/forum.literatureandlatte.com/ldecher/32/23709_2.png) [@ldecher](https://forum.literatureandlatte.com/u/ldecher)\
**Post date:** [November 19, 2026, 4:16pm UTC](https://forum.literatureandlatte.com/t/specify-the-width-of-an-image-by-percentage/155101/3 "2026-11-19T16:16:19Z")

</div>

Thank you SO much for your speedy reply! With your suggestions, I think I’ve fixed it now . . . just waiting to see how the various retailers respond to the finished files.

Regards,

Laurel
