dropdown-js/index.html
2019-10-20 15:10:23 +03:00

79 lines
1.7 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>JS Plugin</title>
<style>
* {
box-sizing: border-box;
}
body {
font-family: sans-serif;
}
.app {
width: 100%;
height: 100vh;
overflow: hidden;
display: flex;
justify-content: center;
padding-top: 50px;
}
.dropdown {
position: relative;
width: 400px;
}
.dropdown.open .dropdown__menu {
display: block;
}
.dropdown__label {
padding: 10px 10px;
border: 1px solid rgb(34, 34, 34);
width: 100%;
cursor: pointer;
}
.dropdown__menu {
list-style: none;
margin: 0;
padding: 0;
display: none;
border-right: 1px solid;
border-left: 1px solid;
position: absolute;
width: 100%;
top: 39px;
}
.dropdown__menu li {
padding: 10px 10px;
border-bottom: 1px solid;
}
.dropdown__menu li:hover {
background-color: rgba(0, 0, 0, .2);
cursor: pointer;
}
</style>
</head>
<body>
<div class="app">
<div class="dropdown" id="dropdown">
<div class="dropdown__label"></div>
<ul class="dropdown__menu"></ul>
</div>
</div>
<script src="./script.js"></script>
</body>
</html>