Source code

Revision control

Copy as Markdown

Other Tools

<!DOCTYPE html>
<style>
:root, body {
margin: 0;
height: 100%;
}
#target {
height: 300px;
background-color: lightBlue;
border: orange 10px solid;
box-sizing: border-box;
}
</style>
<meta name="responsive-embedded-sizing">
<div id="target"></div>
<script>
window.addEventListener('message', e => {
const target = document.getElementById('target');
if (e.data.name === 'height100p') {
target.style.height = '100%';
window.requestResize();
window.parent.postMessage({
name: 'height100pDone',
}, '*');
}
});
</script>