پیشنمایش زنده
کد HTML
<div class="edit-post">
<span class="edit-tooltip">Edit Post</span>
<span class="edit-icon">⚙️</span>
</div>
کد CSS
.edit-post {
position: relative;
background: #ffffff;
color: #000;
padding: 15px;
margin: 10px;
border-radius: 10px;
width: 40px;
height: 40px;
font-size: 17px;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
cursor: pointer;
transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.edit-tooltip {
position: absolute;
top: 0px;
font-size: 14px;
background: #ffffff;
color: #ffffff;
padding: 5px 8px;
border-radius: 5px;
box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
opacity: 0;
pointer-events: none;
transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
width: 150px;
}
.edit-tooltip::before {
position: absolute;
content: "";
height: 8px;
width: 8px;
background: #ffffff;
bottom: -3px;
left: 50%;
transform: translate(-50%) rotate(45deg);
transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.edit-post:hover .edit-tooltip {
top: -45px;
opacity: 1;
visibility: visible;
pointer-events: auto;
}
.edit-icon {
font-size: 24px;
}
.edit-post:hover,
.edit-post:hover .edit-tooltip,
.edit-post:hover .edit-tooltip::before {
background: linear-gradient(320deg, rgb(3, 77, 146), rgb(0, 60, 255));
color: #ffffff;
}