To implement this feature, you can use a combination of HTML, CSS, and JavaScript. Here's a simple example: