<section>
<div id="red">box-1</div>
<div id="green">box-2</div>
<div id="blue">box-3</div>
</section>
section {
margin: 10px;
padding: 10px;
height: 300px;
border: 1px solid black;
}
div {
width: 50px;
height: 60px;
display: inline-block;
margin-right: 20px;
}
#red {
background-color: red;
position: fixed;
top: 0;
left: 0;
}
#green {
background-color: green;
}
#blue {
background-color: blue;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.