Menu
Coddy logo textTech

Buttons - II

Lesson 11 of 13 in Coddy's Sidebar | Front-end Project course.

challenge icon

Challenge

Easy

Target #closeSidebarBtn and #openSidebarBtn:


1. Set the color according to your choice.

2. Set cursor to pointer

3. Change opacity on hover (anything but 1)

 

Target just #openSidebarBtn

1. Set margin of your choice

Try it yourself

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="styles.css">
  <title>Mobile Sidebar</title>
</head>
<body>
  <button id="openSidebarBtn">Open</button>
  <div id="sidebar" class="sidebar">
    <button id="closeSidebarBtn">Close</button>
    <!-- Your sidebar content goes here -->
    <p>Home</p>
    <p>About</p>
    <p>Services</p>
    <p>Contact</p>
  </div>
  <script src="script.js"></script>
</body>
</html>

All lessons in Sidebar | Front-end Project