Hover on Marquee not working for Single word

Viewed 57

This is my CSS:

.tooltip {
  position: relative;
  display: inline-block;
  line-height: 2em;
  padding-bottom: 1em;
  width: 1300px;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 800px;
  background-color: black;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 5px 0;
  /* Position the tooltip */
  position: absolute;
  z-index: 1;
  bottom: 100%;
  left: 50%;
  margin-left: -400px;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
}
<div class="tooltip">
  <marquee behavior="scroll" direction="left" onmouseover="this.stop();" onmouseout="this.start();" scrollamount="25">
    <span style="color: #A60B8D; font-weight: bold;">Note:&nbsp;MOD rates for the month of January are last updated September. Please check the rates from <u>Here</u>. ;</span>

  </marquee>
  <span class="tooltiptext">Download MOD excel from Bills and Statement>View Data>Monthly Data> Select MOD Sheet in Information Type</span>

</div>

I want the text in class tooltip text to be shown when I hover over the Word "Here".

1 Answers

Using Marquee is not recommended in your production site.
If you want to make this work anyway, check below code.

<!DOCTYPE html>
<html>
    <head>

<style>
    .tooltip {
      position: relative;
      display: inline-block;
      line-height: 2em;
      padding-bottom: 1em;
      width: 1300px;
    }

    .here .tooltiptext {
      display: none;
      width: 800px;
      background-color: black;
      color: #fff;
      text-align: center;
      border-radius: 6px;
      padding: 5px 0;
      position: absolute;
      z-index: 1;
      top: 100%;
      //bottom: 100%;
      left: 50%;
      margin-left: -400px;
    }

    .here:hover .tooltiptext {
      display: inline-block;
    }
    </style>
    </head>
<body>
    <div class="tooltip">
      <marquee behavior="scroll" direction="left" onmouseover="this.stop();" onmouseout="this.start();" scrollamount="25">
        <span style="color: #A60B8D; font-weight: bold;">Note:&nbsp;MOD rates for the month of January are last updated September. Please check the rates from <u class="here">Here<span class="tooltiptext">Download MOD excel from Bills and Statement>View Data>Monthly Data> Select MOD Sheet in Information Type</span></u>. ;</span>

      </marquee>

    </div>


    </body>
</html>

Related