<!doctype html>
<html>
	<head>
		<title>Position absolute</title>
		<link href="/assets/reset.css" rel="stylesheet">
		<link href="setup.css" rel="stylesheet">
		<link href="style.css" rel="stylesheet">
	</head>
	<body>
		<section>
			<p>This is some text in the first element.</p>
			<p>There can be multiple elements within it, maybe even that wrap to multiple lines.</p>
		</section>
		<section>
			<p>And some more in the second element.</p>
		</section>
		<section>
			<p>Then a third one, too.</p>
		</section>
		<section>
			<p>Let’s add a fourth.</p>
		</section>
		<section>
			<p>Even a fifth.</p>
		</section>
		<section>
			<p>This should let it scroll.</p>
		</section>
		<section>
			<p>It was the best of times; it was the worst of times.</p>
		</section>
		<section>
			<p>Scrolling is always fun.</p>
		</section>
		<section>
			<p>I guess that isn’t true.</p>
		</section>
		<section>
			<p>Sometimes it goes on and on, you know.</p>
		</section>
		<section>
			<p>Okay, this is enough.</p>
		</section>
		<section>
			<p>Almost there!</p>
		</section>
		<section>
			<p>One more, for good measure.</p>
		</section>
	</body>
</html>

		
index.html
			/* Same as before. */
body {
	font-family: sans-serif;
	padding: 1rem;
}

section {
	background-color: deepskyblue;
	border-block-start: solid black 0.2rem;
	padding: 1rem;
}

section:not(:first-child) { margin-block-start: 1rem; }

		
setup.css
			section:nth-child(3) {
	background-color: gold;
	inline-size: 66%;
	inset-block-start: 3rem;
	inset-inline-start: 3rem;
	position: absolute; /* Here, in relation to `body`. */
}

section:nth-child(5) {
	background-color: tomato;
	position: relative; /* The closest relative ancestor. */

	p {
		inset-block-end: 3rem;
		inset-inline-end: 3rem;
		position: absolute; /* From the parent section. */
	}
}

		
style.css