运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
转到空间
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <style> body {font-family: "Lato", sans-serif;} .sidebar { height: 100%; width: 160px; position: fixed; z-index: 1; top: 0; left: 0; background-color: #111; overflow-x: hidden; padding-top: 16px; } .sidebar a { padding: 6px 8px 6px 16px; text-decoration: none; font-size: 20px; color: #818181; display: block; } .sidebar a:hover { color: #f1f1f1; } .main { margin-left: 160px; /* Same as the width of the sidenav */ padding: 0px 10px; } @media screen and (max-height: 450px) { .sidebar {padding-top: 15px;} .sidebar a {font-size: 18px;} } </style> </head> <body> <div class="sidebar"> <a href="#home"><i class="fa fa-fw fa-home"></i> Home</a> <a href="#services"><i class="fa fa-fw fa-wrench"></i> Services</a> <a href="#clients"><i class="fa fa-fw fa-user"></i> Clients</a> <a href="#contact"><i class="fa fa-fw fa-envelope"></i> Contact</a> </div> <div class="main"> <h2>Sidebar with Icons</h2> <p>This side navigation is of full height (100%) and always shown.</p> <p>Lorem ipsum dolor sit amet, illum definitiones no quo, maluisset concludaturque et eum, altera fabulas ut quo. Atqui causae gloriatur ius te, id agam omnis evertitur eum. Affert laboramus repudiandae nec et. Inciderint efficiantur his ad. Eum no molestiae voluptatibus.</p> <p>Lorem ipsum dolor sit amet, illum definitiones no quo, maluisset concludaturque et eum, altera fabulas ut quo. Atqui causae gloriatur ius te, id agam omnis evertitur eum. Affert laboramus repudiandae nec et. Inciderint efficiantur his ad. Eum no molestiae voluptatibus.</p> </div> </body> </html>