Set up basic dropdown exercise
This commit is contained in:
parent
1771e1d86e
commit
f883283308
|
@ -0,0 +1,7 @@
|
|||
# Dropdown
|
||||
|
||||
## Desired Outcome
|
||||
|
||||
![outcome](./desired-outcome.gif)
|
||||
|
||||
### Self Check
|
|
@ -0,0 +1,22 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Dropdown</title>
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="dropdown-container">
|
||||
<div class="dropdown-menu">
|
||||
<button class="dropdown-button">Dropdown</button>
|
||||
<div class="dropdown-content">
|
||||
<a href="#">Link 1</a>
|
||||
<a href="#">Link 2</a>
|
||||
<a href="#">Link 3</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,58 @@
|
|||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.dropdown-container {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.dropdown-button {
|
||||
background-color: rgb(108, 238, 255);
|
||||
padding: 16px;
|
||||
font-size: 16px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.dropdown-content {
|
||||
visibility: hidden;
|
||||
position: absolute;
|
||||
left: -25%;
|
||||
background-color: rgb(189, 188, 188);
|
||||
width: 160px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
/* max-height: 0; */
|
||||
/* transition: max-height 0.25s ease-out; */
|
||||
}
|
||||
|
||||
a {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
color: black;
|
||||
padding: 12px 16px;
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.dropdown-menu:hover .dropdown-content {
|
||||
visibility: visible;
|
||||
/* max-height: 500px;
|
||||
transition: max-height 0.25s ease-out; */
|
||||
}
|
||||
|
||||
.dropdown-menu:hover .dropdown-button {
|
||||
cursor: pointer;
|
||||
background-color: rgb(59, 232, 255);
|
||||
}
|
||||
|
||||
.dropdown-content a:hover {
|
||||
background-color: #ddd;
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Dropdown</title>
|
||||
<link rel="stylesheet" href="solution.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="dropdown-container">
|
||||
<div class="dropdown-menu">
|
||||
<button class="dropdown-button">Dropdown</button>
|
||||
<div class="dropdown-content">
|
||||
<a href="#">Link 1</a>
|
||||
<a href="#">Link 2</a>
|
||||
<a href="#">Link 3</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,41 @@
|
|||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.dropdown-container {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.dropdown-button {
|
||||
background-color: rgb(108, 238, 255);
|
||||
padding: 16px;
|
||||
font-size: 16px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.dropdown-content {
|
||||
visibility: hidden;
|
||||
position: absolute;
|
||||
left: -25%;
|
||||
background-color: rgb(189, 188, 188);
|
||||
width: 160px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
a {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
color: black;
|
||||
padding: 12px 16px;
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
# Popup
|
||||
|
||||
## Desired Outcome
|
||||
|
||||
![outcome](./desired-outcome.gif)
|
||||
|
||||
### Self Check
|
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Popup</title>
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="popup-container"></div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Popup</title>
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="popup-container"></div>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue