project demo
html code
CSS Card Hover Effect - Dark CSS
Hover Me
Hover Me
Hover Me
css code
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
html,
body {
display: grid;
height: 100%;
background: #e8e8e8;
place-items: center;
font-family: 'Poppins', sans-serif;
}
.wrapper {
background: blueviolet;
color: #fff;
height: 250px;
width: 250px;
display: flex;
justify-content: center;
align-items: center;
gap: 5px;
}
.wrapper .card {
flex: 1;
height: 100%;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
border-radius: 2px;
transition: all .5s;
background: blueviolet;
border: 1px solid #fff;
}
.card p {
min-width: 13rem;
text-transform: uppercase;
transform: rotate(-90deg);
text-align: center;
font-size: 12px;
transition: all .5s;
}
.card:hover {
flex: 4;
}
.card:hover p {
transform: rotate(0deg);
}