If your site has a team-member page with images, names, phone, email, etc., you can create rollovers to show all the pertinent info for each team member.
HTML
CSS
.member_container {
position: relative;
width: 320px;
border: red solid 4px;
}
img.team_member {
width: 100%;
height: auto;
}
.overlay {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background-color: rgba(0,0,0,0.7);
overflow: hidden;
width: 100%;
height: 0;
transition: all 0.4s ease;
}
.member_container:hover .overlay {
height: 100%;
}
.member_name {
white-space: nowrap;
color: white;
font-size: 18px;
text-align: center;
position: absolute;
overflow: hidden;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.member_name a {
color: white;
text-decoration: none;
border-bottom: white solid thin;
}
Examples
Each example below shows the changes in the CSS above to get that effect.
From Bottom (default)
.overlay {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background-color: rgba(0,0,0,0.7);
overflow: hidden;
width: 100%;
height: 0;
transition: all 0.4s ease;
}
.member_container:hover .overlay {
height: 100%;
}
From Top
.overlay {
position: absolute;
bottom: 100%;
left: 0;
right: 0;
background-color: rgba(0,0,0,0.7);
overflow: hidden;
width: 100%;
height: 0;
transition: all 0.4s ease;
}
.member_container:hover .overlay {
height: 100%;
bottom: 0;
}
From left
.overlay {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background-color: rgba(0,0,0,0.7);
overflow: hidden;
width: 0;
height: 100%;
transition: all 0.4s ease;
}
.member_container:hover .overlay {
width: 100%;
}
From Right
.overlay {
position: absolute;
bottom: 0;
left: 100%;
right: 0;
background-color: rgba(0,0,0,0.7);
overflow: hidden;
width: 0;
height: 100%;
transition: all 0.4s ease;
}
.member_container:hover .overlay {
width: 100%;
left: 0;
}
We’d like to acknowledge that we learned a great deal of our coding from W3Schools and TutorialsPoint, borrowing heavily from their teaching process and excellent code examples. We highly recommend both sites to deepen your experience, and further your coding journey. We’re just hitting the basics here at 1SMARTchicken.
Why 1SMARTchicken?
See More →
Thanks for your support!
CSS Books
All are affiliate links. Thank you for your support!
CSS NOTES:
- The “inherit”, “initial” and “unset” keywords can be used with any CSS property to set its value
- In CSS there are many ways to express a color value in a property
Feedback
If you see an error on the page or the code itself is incorrect or incomplete, or just plain wrong, please let us know. We’re always learning. NOTE: we do not sell your information and will not send you spam emails.