How can I prevent the background hover color from spreading from the descriptive section to the item section in Qualtrics?

Let me start off by apologizing for any confusion in the wording of this question. I'm trying my best to be clear. Essentially, I have two goals:

  • I managed to program a tooltip with a table into the question area of Qualtrics.
  • I want the background color of each row to change when someone hovers over it.

I've achieved the second goal, but now I'm facing an issue where the background color is bleeding into the item response area. I can't figure out how to fix it. I've been going through the code repeatedly, and I feel like I might be missing something simple. The code I've used is below. Any assistance would be greatly appreciated. Thank you!

Javascript (in the header under Look & Feel):

.myExpandItem
{
text-decoration: underline;
position: relative;
}

.myExpandItem:hover .myExpandBox {
display: block;
}

.myExpandBox
{
position: absolute;
background: white;
opacity: 1;
border: 10px solid rgba(0, 0, 0, 0.3);
border-radius: 15px;
min-height: 200px;
min-width: 450px;
display: none;
left: 300px;
top: -375px;
padding: 10px;
color: black;
font-size: 12.000000pt; 
font-family: 'Arial';
}

And here's the associated HTML code within the body:

<span style="font-size:16px;"><span style="font-
family:arial,helvetica,sans-serif;">To remind yourself of the 
description for each area, hover over the link named BLAH below.
</span></span>&nbsp;<div><br>

<span class="myExpandItem"><div align="right">BLAH</div><span 
class="myExpandBox">

<style type="text/css">

table {
overflow: hidden;
border-collapse: collapse;
}

td, th {
padding: 10px;
position: relative;
outline: 3;
}

tbody tr:hover {
background-color: lightblue;
}

</style>


<table style="background: white;border-radius:15px;-moz-border-
radius:15px;-webkit-border-radius:15px;">

<thead>
  <tr>
    <th class="col"><h4>Area</h4></th>
    <th class="col"><h4>Description</h4></th>
  </tr>
</thead>
<thead>
    <tr>
         <td colspan="2"><hr></td>
    </tr>
</thead>
<tbody>
  <tr>
    <td>ITEM 1</td>
    <td>DEFINITION.
</td>
  </tr>

  <tr>
    <td>ITEM 2</td>
    <td>DEFINITION.
 </td>
  </tr>

  <tr>
    <td>ITEM 3</td>
    <td>DEFINITION.</td>
  </tr>
 </tbody><tbody>

 </tbody></table>

 </span> 
 </span>

When hovering over the item response area, you'll notice that the light blue background "bleeds" over. Your help is highly valued. Thank you in advance for any assistance provided.

Answer №1

After making changes to the markup, I have successfully resolved the issue at hand. While I believe there may be a more elegant solution out there, any feedback or suggestions would be greatly welcomed. In any case, I hope that this modification can benefit others who encounter similar challenges.

<span class="myExpandItem"><div align="right">BLAH</div><span 
class="myExpandBox">

<style style="text/css">

.hoverTable{
    width:100%; 
    border-collapse:collapse; 
}

 .hoverTable td{ 
      padding:7px;
 }

 .hoverTable tr{
      background: white;
 }

 .hoverTable tr:hover {
      background-color: lightblue;
 }

.hoverTable tr:first-child:hover {
      background-color: white;
 }

.hoverTable td:first-child:hover {
      background-color: white;
 }


table#t01 {
      overflow: hidden;
      border-collapse: collapse;
      background-color: white;
      border-radius:15px;
      -moz-border-radius:15px;
      -webkit-border-radius:15px;
}

</style>


<table id="t01"; class = "hoverTable">

    <tr:first-child>
        <th class="col"><h4>Area</h4></th>
        <th class="col"><h4>Description</h4></th>
    </tr>

    <td:first-child>
         <td colspan="2"><hr></td>
    </tr>

    <tr>
        <td>ITEM 1</td>
        <td>DEFINITION.</td>
    </tr>

    <tr>
        <td>ITEM 2</td>
        <td>DEFINITION.</td>
    </tr>

    <tr>
        <td>ITEM 3</td>
        <td>DEFINITION.</td>
    </tr>

</table>

</span> 
</span>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

How to simulate loadStripe behavior with Cypress stub?

I am struggling to correctly stub out Stripe from my tests CartCheckoutButton.ts import React from 'react' import { loadStripe } from '@stripe/stripe-js' import useCart from '~/state/CartContext' import styles from '. ...

What are the proper ways to implement JavaScript conditions?

Having an issue with my slider function, as it currently only works once with the moveRight() method. To address this problem, I attempted to implement a condition that disables the move function and modifies the attributes of links on the second click. H ...

Creating a personalized Angular filter to format various object properties in version 1.5

Trying to figure out how to create a custom Angular 1.5 filter to format values of different object properties. The HTML file includes this code inside an ng-repeat: <div>{{::object.day || object.date || 'Something else'}}</div> S ...

Tips for transferring state value from a form to a child modal

As a newcomer to React, I am uncertain about the best approach to take in my project. Specifically, I have a modal component that should appear once the user fills out a form and clicks on the Preview Voucher button to display the entered values. Below, yo ...

Enhancing Text Clarity on iOS Devices

I've created a webapp that works smoothly on the majority of mobile devices. However, I've noticed that occasionally on my iPhone 5s (and I've heard similar experiences from users on other iOS devices), the text appears blurry. This issue se ...

Reordering Divs in Bootstrap 3 Specifically for Small Screens

Just getting started with my first responsive design project, and I'm wondering if it's possible to achieve something like this using Bootstrap 3. The goal is to switch from the current layout: https://i.stack.imgur.com/lABXp.jpg To https://i. ...

Combining multiple jQuery selector objects into one jQuery object

How can I merge two jQuery selectors into one jQuery object? I attempted to use $("#selector","#selector"), but it didn't work and just returned blank. Are there any built-in methods that can help me accomplish this? Is there a way to do it like thi ...

iOS devices featuring the scroll function allows for seamless navigation and effortless

Here is the code snippet that I am using: $(document).scroll(function() { thedistance(); }); I would like thedistance() to trigger while a user is scrolling on an iOS device, however, it currently only fires after the scrolling has stopped, rather t ...

Is it possible for a user to modify the JavaScript code on a website?

As I develop a website that heavily relies on JavaScript, I am curious about the possibility of users being able to edit the JS code themselves. For instance, if I have an ajax function that calls a.php, could a user modify the function using Firebug or a ...

streaming an HTML5 video directly from memory source

After retrieving multiple encrypted data using ajax queries and performing necessary manipulations to turn them into a valid video, I find myself at a standstill. The binary of the video is now stored in memory, but I am unsure how to display it. To confi ...

What causes WordPress to take precedence over Bootstrap?

Trying to integrate a Bootstrap theme I created into WordPress, but encountering issues. Despite enqueuing all necessary style sheets without errors in the console, WordPress is interfering with the layout. The rounded circles with images are appearing s ...

Conflicting Media Queries causing issues

Seeking assistance on media queries for my website. It currently has two responsive viewports: max-width: 414 px (iPhone) and max-width: 770px (iPad) While the style tags are in the correct order in the css document, the cascading nature is causing my ...

The controls for the HTML audio component are missing the download option on Safari

In my React application, I've declared an audio component with controls like the following: <audio controls> <source src={url} /> </audio> While this setup works perfectly in most browsers, it seems to have a bug when used in Safa ...

Move the list element upwards to the top position with animation

I am currently utilizing Angular version one and I have set up a news feed with lists of posts. Each post includes various action buttons. One of these buttons, when clicked (referred to as button X), will move the post to the top of the list, similar to t ...

How can I transform each word to resemble this format?

let sentence = "Hello+world + like+ this + name,bla"; sentence = sentence.replace(/\+\s\+/g, function(match){ return "*" + match.trim() + "*"; }); alert(sentence); // Output will be " *Hello*+*world*+like*+this*+name,*bla* "; How can I ...

When onSubmit is triggered, FormData is accessible. But when trying to pass it to the server action, it sometimes ends up as null

I am currently utilizing NextJS version 14 along with Supabase. Within my codebase, I have a reusable component that I frequently utilize: import { useState } from 'react'; interface MyInputProps { label: string; name: string; value: stri ...

Scroll down 1 page using Javascript and Jquery

Hey there! I'm looking to create a website where a small scroll on the mouse wheel will take the site to the next anchor. It's kind of hard to explain, but one good example is the Tesla Model 3 website on the US site here. Does anyone have any t ...

Navigation bar not adjusting to the size of the mobile device's screen

My website can be found at . I'm trying to make my navbar mobile-friendly and usable on all devices. However, when I tested it on my iPhone, the navbar appears extremely tiny. Please inspect the code using dev tools to see what I mean. Below is the co ...

Tracking and managing user clicks on external links within a vue.js application

I am currently working on a web application that retrieves data from a CMS. Utilizing the Vue-Router in 'history' mode, I need to address content fetched from the API which may include links. My goal is to manage specific links using the router w ...

Converting User Input Special Characters to HTML5 data-attributes with URL Encoding/Decoding

Seeking assistance from the experts on my first question here at stackoverflow. Our web application allows users to input escape/special characters, and we are conducting testing for extreme scenarios. I have successfully passed escape characters through a ...