Public
Edited
Dec 12, 2022
1 star
Insert cell
Insert cell
Insert cell
<style>
.box-1 {
width: ${width}px;
}
.box-1 h2 {
display: inline-block;
}
</style>

<div class="box box-1">
<h2>1</h2>
</div>
Insert cell
Insert cell
<style>
.box-2 {
width: ${width}px;
display: flex; /* make the container div to make it a flex item. */
justify-content: center; /* center out item horizontally */
}
.box-2 h2 {
display: inline-block;
}
</style>

<div class="box box-2">
<h2>2</h2>
</div>
Insert cell
Insert cell
<style>
.box-3 {
width: ${width}px;
height: 400px;
display: flex;
justify-content: center;
align-items: center; /* vertically center to the parent container */
}
.box-3 h2 {
display: inline-block;
}
</style>

<div class="box box-3">
<h2>3</h2>
</div>
Insert cell
Insert cell
<hr>
<link href="https://fonts.googleapis.com/css?family=Space+Mono" rel="stylesheet">
<style>
.box {
margin: 0px;
padding: 0px;
border: 4px dashed #5c2c45;
}
.box h2 {
background: #29bdad;
padding: 20px;
margin: 0px;
font-size: 36px;
font-weight: 400;
font-family:'Space Mono',monospace;
color: #5c2c45;
}
</style>
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more