Have describing text appear in specific location on icon/image hover

Issue

I know how to get the text to appear on hover but I want the text to appear in a specific location (location attached), when hovering the image/icon. I say icons because they are used as mounting icons in this application. Please see the attached image for more details.

More Details: ~ IMG

.cd-button {
  transition: all .0s;
  margin: 5px;
  text-decoration: none;
  display: inline-block;
  background: white;
  height: 50%;
  width: 100%;
  line-height: 25px;
  text-align: center;
  color: black;
  margin: auto;
  border-radius: 5px;
}

.series-text {
  margin: 5px;
  position: relative;
  max-width: 100%;
  text-align: center;
  font-size: 1.5rem;
}

.product-name {
  margin-top: 0rem;
  margin-bottom: 2rem;
  position: relative;
  max-width: 100%;
  margin-bottom: 2rem;
  font-weight: bold;
  padding-left: 1.5rem;
}

.row-spacing {
  padding-bottom: 4rem;
  max-width: 100%;
  margin: initial;
}

.cta-content {
  opacity: 0;
  display: block;
  transition: opacity 0.1s ease-in-out;
  -moz-transition: opacity 0.1s ease-in-out;
  -webkit-transition: opacity 0.1s ease-in-out;
  z-index: 1;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background: rgba(242, 242, 242, .9);
  text-align: center;
  color: #000000;
  padding: 0 1rem 1.5rem;
  margin-top: 4.5rem;
  margin-left: 1rem;
  margin-right: 1rem;
}

.bullet-text {
  margin-top: 0rem;
  margin-bottom: 0rem;
  font-size: medium;
  margin-block-end: 0rem;
  text-align: left;
  padding-inline-start: 30px;
}

.product-display .col-content {
  -webkit-box-shadow: 1px 2px 6px -1px rgb(0 0 0 / 20%);
  -moz-box-shadow: 1px 2px 6px -1px rgba(0, 0, 0, 0.2);
  -ms-box-shadow: 1px 2px 6px -1px rgba(0, 0, 0, 0.2);
  box-shadow: 1px 2px 6px -1px rgb(0 0 0 / 50%);
  padding: 0 1rem 1.5rem;
  margin: 0 .5rem .5rem;
  text-align: center;
  padding-top: 3%;
  padding-bottom: 3%;
  border-radius: 5px;
}

.caster-series-image {
  width: auto;
  height: auto;
  border: 0;
  margin: 0px;
  padding: 10px;
}

.mounting-icon {
  height: auto;
  width: auto;
  padding-top: 5px;
  margin: -3px;
  margin-top: -.5rem;
  margin-bottom: 0rem;
}

.mounting-spacing {
  margin-bottom: 0rem;
}

ul>li,
ol>li {
  margin-top: 0rem;
  margin-bottom: 4px;
}
<div class="col-3 row-spacing">
  <div class="col-12">
    <h3 class="product-name"><a href="{{config path=" web/secure/base_url "}}/brands/shepherd-casters/casters/regent-series.html"><span style="color: #007dbd;">Regent</span></a></h3>
    <div class="col-content">
      <a href="{{config path=" web/secure/base_url "}}/brands/shepherd-casters/casters/regent-series.html"><img src="https://casterdepot.com/media/Shepherd/regent.jpg" class="caster-series-image" alt=""></a>
      <div class="cta-content">
        <p class="series-text"><b>Additional Features</b></p><br>
        <ul class="bullet-text">
          <li><b>Overall Height:</b> 2 &frac34;" - 3 <sup>7</sup>&#8260;<sub>32</sub>"</li>
          <li><b>Applications:</b> Store fixtures, Carts, Institutional Equipment, Food Serverice Equipment, Furniture, Janitorial Equipment, Office Equipment, Racks and Storage Equipment, Medical Equipment</li>
        </ul>

      </div>
    </div>
  </div>
  <div class="col-12">
    <div class="col-content">
      <ul class="bullet-text">
        <li><b>Capacity:</b> 80-160 lbs</li>
        <li><b>Sizes:</b> 2", 2 &frac12;", 3", 4", 5"</li>
        <li><b>Mounting Options:</b></li>
      </ul>
      <p class="mounting-spacing"><img src="https://casterdepot.com/media/mounting-icons/top-plate-icon.jpg" class="mounting-icon" title="Top Plate" alt="top-plate"><img src="https://casterdepot.com/media/mounting-icons/threaded-stem-icon.jpg" class="mounting-icon" title="Threaded Stem"
          alt=""><img src="https://casterdepot.com/media/mounting-icons/grip-neck-stem-icon.jpg" class="mounting-icon" title="Grip Neck Stem" alt=""><img src="https://casterdepot.com/media/mounting-icons/grip-ring-stem-icon.jpg" class="mounting-icon" title="Grip Ring Stem"
          alt=""><img src="https://casterdepot.com/media/mounting-icons/expanding-stem-icon.jpg" class="mounting-icon" title="Expanding Stem" alt=""></p>
      <a href="{{config path=" web/secure/base_url "}}/brands/shepherd-casters/casters/regent-series.html">
        <button class="cd-button" type="button">Read More</button>
      </a>
    </div>
  </div>
</div>

Solution

.row {
  display: flex;
  flex-direction: row;
}
<head>
  <script type="text/javascript">
      
    const showText = () => {
      var text = document.getElementById('hidden-text');
      text.innerHTML = "Showing";
    }
              
    const hideText = () => {
        var text = document.getElementById('hidden-text');
        text.innerHTML = "";
    }    
  </script>
</head>

<div class='row'><p>Example: <p/><p id='hidden-text'></p></div>
<p id='hover-text' onmouseover={showText()} onmouseout={hideText()}>hover me</p>

Answered By – DrewCouturier

Answer Checked By – Jay B. (AngularFixing Admin)

Leave a Reply

Your email address will not be published.