Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to access specific div inside td and showing different background color when hovering

I have a table and in my td, I will have div. I need know how let user see different color when hovering at specific div

My code

      <div className="table-responsive">
      <table className="table table-responsive table-hover table-condensed returnSpreadIndex">
          <thead>
              <tr>
                  <th>Period/Range</th>
                  <th>n30</th>



              </tr>
          </thead>
             <tbody>
             <tr>
               <td>
                 <div class="hover1"> // LET SAY USER HOVER THIS DIV, WILL SHOW YELLOW COLOR
                 Apple1
                 </div>
                 <div class="hover2"> // IF USER HOVER THIS DIV, WILL SHOW ORANGE COLOR
                 pineApple1
                 </div>
               </td>
               <td>testing purpose</td>
             </tr>
             <tr>
               <td>test</td>
               <td>
                 <div>
                 Apple2
                 </div>
                 <div>
                 pineApple2
                 </div>
               </td>
             </tr>
             </tbody>
        </table>
   </div>

after I lookup solution for this , finally can come out with this code but it is not working either

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

div.table-responsive table.returnSpreadIndex tbody > tr > td>div:hover .hover1 {
background-color: yellow;
}

div.table-responsive table.returnSpreadIndex tbody > tr > td>div:hover .hover2 {
background-color: orange;
}

Thank you,

>Solution :

.hover1:hover { background-color: yellow} .hover2:hover {background-color: orange}
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading