<div class="notice">
👋 Hey, looks like your browser does not support <code>margin-block</code>. Try viewing this demo in Firefox or Chrome.
</div>
<div class="wrapper">
<h1 class="h-lr">↕️ Hello Dolly!</h1>
</div>
<div class="wrapper">
<h1 class="v-lr">↕️ Hello Dolly!</h1>
</div>
:root {
--start: 25%;
--end: 100px;
}
body {
padding: 1.5rem;
}
.wrapper {
background: #100e17;
border-radius: 8px;
height: 300px;
margin-bottom: 2rem;
padding: 1rem;
position: relative;
width: clamp(300px, 90%, 800px);
}
h1 {
color: #fff;
margin-block: var(--start) var(--end);
position: relative;
}
.v-lr {
writing-mode: vertical-lr;
}
.notice {
background: #fff9c4;
border-radius: 8px;
color: #827717;
margin-bottom: 1.5rem;
padding: 1rem;
text-align: center;
width: clamp(300px, 90%, 800px);
}
@supports (margin-block: 0) {
.notice {
display: none;
}
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.