JSFiddle - React, Tailwind, and code Playground
by Pankaj Kargirwar
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
#scrollable-container {
overflow-y: auto;
height: 200px; /* Set a fixed height for demonstration purposes */
padding-top: 20px; /* Add padding to the top */
background-color: #f0f0f0; /* Just for better visualization */
}
/* Add some content to demonstrate scrolling */
#content {
height: 500px; /* Content height exceeds container height to enable scrolling */
}
</style>
</head>
<body>
<div id="scrollable-container">
<div id="content">
<!-- Your scrollable content goes here -->
<!-- ... -->
</div>
</div>
</body>
</html>