Toggle navigation
☰
HTML
CSS
Scripting
Database
<!DOCTYPE html> <html> <head> <title>CSS Grid Sidebar Menu Example</title> <style> body { font-family: sans-serif; margin: 0; } .grid-container { display: grid; grid-template-columns: 200px 1fr; min-height: 100vh; } .sidebar { background-color: #34495e; color: white; padding-top: 20px; } .sidebar a { padding: 10px 15px; text-decoration: none; font-size: 18px; color: #ecf0f1; display: block; } .sidebar a:hover { color: #fff; background-color: #2c3e50; } .main { padding: 20px; background-color: #ecf0f1; } </style> </head> <body> <div class="grid-container"> <nav class="sidebar"> <a href="#">Home</a> <a href="#">Services</a> <a href="#">Clients</a> <a href="#">Contact</a> </nav> <div class="main"> <h2>Main Content Area</h2> <p>This layout uses CSS Grid to define a clear 2-column structure for the sidebar and the main content. The <code>grid-template-columns: 200px 1fr;</code> property handles the width of both areas.</p> </div> </div> </body> </html>