diff --git a/.epub/example/OEBPS/scripts/ipub.js b/.epub/example/OEBPS/scripts/ipub.js
index 901bdfc..7af3355 100644
--- a/.epub/example/OEBPS/scripts/ipub.js
+++ b/.epub/example/OEBPS/scripts/ipub.js
@@ -126,10 +126,14 @@ class IPUBContent extends HTMLElement {
static elementName = "ipub-content";
}
+class IPUBImage extends HTMLElement {
+ static elementName = "ipub-image";
+}
+
globalThis.addEventListener("load", () => {
console.info("IPUB: STARTING DEFINITIONS");
- [IPUBBackground, IPUBContent].forEach((e) => {
+ [IPUBBackground, IPUBContent, IPUBImage].forEach((e) => {
console.info(`IPUB: Defining custom element <${e.elementName}>`);
globalThis.customElements.define(e.elementName, e);
});
diff --git a/.epub/example/OEBPS/sections/section0001.xhtml b/.epub/example/OEBPS/sections/section0001.xhtml
index bb42072..7696f03 100644
--- a/.epub/example/OEBPS/sections/section0001.xhtml
+++ b/.epub/example/OEBPS/sections/section0001.xhtml
@@ -14,7 +14,9 @@
+
+
diff --git a/.epub/example/OEBPS/styles/stylesheet.css b/.epub/example/OEBPS/styles/stylesheet.css
index f1f7f38..8aaa478 100644
--- a/.epub/example/OEBPS/styles/stylesheet.css
+++ b/.epub/example/OEBPS/styles/stylesheet.css
@@ -96,7 +96,18 @@ ipub-background {
}
}
+ipub-image {
position: relative;
+ display: block;
+ flex-direction: column;
+
+ width: var(--ipub-width, unset);
+ height: var(--ipub-height, unset);
+
+ img {
+ max-width: 100%;
+ max-height: 100%;
+ }
}
[data-ipub-element="image"] {