I used the following code from this article here
I'm currently looking for how to transition the like text (Like -> Liked) after somebody liked my post. My blog: https://14test.tumblr.com
CSS
.custom-like-button {
position: relative;
display: block;
width: 40px;
height: 40px;
cursor: pointer;
}
.like_button {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
opacity: 0;
z-index: 10;
}
.like_button iframe {
width: 100% !important;
height: 100% !important;
}
.our_button {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
z-index: 1;
}
.like_button:hover + .our_button {
color: red;
}
.like_button.liked + .our_button {
background: white;
color: red;
}
HTML
<center>
<div class="custom-like-button">
{LikeButton}
<span class="our_button">
♥
</span>
</div>
</center>
You can achieve this relatively easily using the pseudo before or after css selector.
I would do this:
You can add anything into the
contentfield, but this will append the content into the our_button wrapper, so you might want to remove the heart and not have any existing HTML content inside the container. IE just use pseudo after css to control the text.<span class="our_button"></span>HTH