Created
October 7, 2018 11:47
-
-
Save gknasln/9eafc435058d4bb0a4adc2cd8627b7e6 to your computer and use it in GitHub Desktop.
Untitled
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.container{ | |
position: relative; | |
margin: 90px; | |
} | |
.dropdown{ | |
position: absolute; | |
top: 110%; | |
left: -50px; | |
display: flex; | |
flex-direction: column; | |
border: 1px solid lightgray; | |
overflow: hidden; | |
transition: transform 0.4s, border-radius 0.5s; | |
transform-origin: top center; | |
transform: scale(0); | |
border-radius: 100% 100% 50% 50%; | |
box-shadow: 0 5px 25px 2px rgba(0, 0, 0, 0.2); | |
} | |
.dropdown a{ | |
padding: 7px 13px; | |
font-family: 'Helvetica'; | |
font-size: 15px; | |
cursor: pointer; | |
border: 1px solid rgb(250, 250, 250); | |
} | |
.active{ | |
transform: scale(1); | |
border-radius: 0; | |
} | |
.dropdown a:hover{ | |
background-color: lightblue; | |
} | |
.dropdown a:active{ | |
background-color: lightskyblue; | |
} | |
.dropdown a::selection{ | |
background: none; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container"> | |
<button> Bana tıkla </button> | |
<div class="dropdown"> | |
<a>gknasln@hotmail.com</a> | |
<a>gknasln@gmail.com</a> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.querySelector('button').addEventListener('click', function(){ | |
this.parentElement.querySelector('.dropdown').classList.toggle('active'); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment