Absolute Container
<zn-absolute-container> | ZnAbsoluteContainer
The absolute container will take the total inner height of the content (positioned absolute), and set that as it’s min height, Creating enough space to show the content.
<zn-sidebar> <div style="display: flex; flex-direction: column; position: relative;"> This is content on the outside <zn-absolute-container> <div style="background-color: var(--zn-color-amber-100); height: 400px; width: 100%; position: absolute;"> This is the content of the absoloute </div> </zn-absolute-container> </div> </zn-sidebar>
Examples
The absolute container is used to wrap absolute elements, that would otherwise cause problems with the dom.
<div style="display: flex; position: relative;"> <zn-absolute-container> <div style="background-color: var(--zn-color-amber-100); height: 400px; width: 100%; position: absolute;"> This is the content of the absoloute </div> </zn-absolute-container> </div>
Importing
If you’re using the autoloader or the traditional loader, you can ignore this section. Otherwise, feel free to use any of the following snippets to cherry pick this component.
To import this component from the CDN using a script tag:
<script type="module" src="https://cdn.jsdelivr.net/npm/@kubex/zinc@1.0.0/dist/components/absolute-container/absolute-container.js"></script>
To import this component from the CDN using a JavaScript import:
import 'https://cdn.jsdelivr.net/npm/@kubex/zinc@1.0.0/dist/components/absolute-container/absolute-container.js';
To import this component using a bundler:
import '@kubex/zinc/dist/components/absolute-container/absolute-container.js';
Slots
Name | Description |
---|---|
(default) | The default slot |
Learn more about using slots.