ADDING TEXT ON IMAGE – HOVER EFFECT ON VIDEO SCREEN

Add the following code in CSS.

.tariff .tariff-thumbnail{
  height: auto;
  overflow: hidden;
  position: relative;
}
 
.tariff .tariff-price{
  position: absolute;
  left: 0;
  bottom: 0;
  background: #3367d6;
  color: white;
  padding: 7px 8px 9px;
  text-align: center;
  width: 63px;
  z-index: 10;
}

Screenshot of our output.

We need to add HTML code as here

<div class="tariff">
<div class="tariff-thumbnail">
<div class="tariff-price">
            <?php if ( get_post_meta( get_the_ID(), $prefix . 'tariff-price',  true) != '' ) { ?>
                <span class="tariff-price">₹ :
                    <?php echo get_post_meta( get_the_ID(), $prefix . 'tariff-price',  true); ?>
                </span>
            <?php } ?></div>
<!-- tariff-price -->
        <?php if ( has_post_thumbnail() ) : ?>
            <a href="<?php echo get_permalink(); ?>">
                <?php the_post_thumbnail( 'large', array( 'class' => 'img-responsive, img-rounded' ) ); ?>
            </a>
        <?php endif; ?></div>
<!-- tariff-thumbnail --></div>
<!-- tariff-->
 

 

Second example adding Hover Effect on Video Screen or Gallery

Add CSS code

.tamo-video-box-layout {
    display: block;
    position: relative;
    margin: 0 auto;
}
.tamo-video-player-content {
    display: block;
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 100%;
    text-align: center;
    color: #fff;
    opacity: 1;
    -webkit-transition: all .35s;
    -moz-transition: all .35s;
    transition: all .35s;
}
.tamo-video-player-content img {
    width:5em;
    opacity: 0.5;
    transition: 1.5s;
    -webkit-transition: 1.5s;
    -moz-transition: 1.5s;
}
.tamo-video-player {
    position: absolute;
    top: 50%;
    width: 100%;
    text-align: center;
    -ms-transform: translateY(-50%);
    -webkit-transform: translateY(-50%);
    -moz-transform: translateY(-50%);
    -o-transform: translateY(-50%);
    transform: translateY(-50%);
    color: #fff;
    text-transform: uppercase;
    line-height: 2;
    padding: 15px;
}
.screenshot-grid-video:hover .tamo-video-player-content img {
    -webkit-transform: scale(1.3);
    -moz-transform: scale(1.3);
    -o-transform: scale(1.3);
    -ms-transform: scale(1.3);
    transform: scale(1.3);
    opacity: 1;
    -ms-filter: none;
    filter: none;
    opacity: 0.8;
    transition: 1.5s;
    -webkit-transition: 1.5s;
    -moz-transition: 1.5s;
}

 

HTML Code

<section class="front-video w3-container">
  <h1 class="w3-center">LATEST VIDEO</h1>
  <div class="w3-row-padding">
    <div class="w3-col m6">
      <div class="screenshot-grid-video">
        <a href="" class="tamo-video-box-layout">
          <img src="images/video1-screenshot.jpg" alt="" style="width:100%;">
          <div class="tamo-video-player-content">
            <div class="tamo-video-player">
              <img src="images/video-player.png" alt="video-player">
            </div>
          </div>
        </a>
      </div>
      <h4 style="text-align:center;">WORLD IS ALIVE</h4>
    </div> <!-- End of column 1-->
    <div class="w3-col m6">
      <div class="screenshot-grid-video">
        <a href="" class="tamo-video-box-layout">
          <img src="images/video2-screenshot.jpg" alt="" style="width:100%;">
          <div class="tamo-video-player-content">
            <div class="tamo-video-player">
              <img src="images/video-player.png" alt="image-rounded">
            </div>
          </div>
        </a>
      </div>
      <h4 style="text-align:center;">LOVE LIVE LIFE</h4>
    </div> <!-- End of column 2 -->
  </div> <!-- End of row -->
</section>
Advertisements
Occasionally, some of yo