Parent table rows' background color isn't displaying properly in Chrome when their child cells are not visible

My current scenario is similar to the one demonstrated in this jsfiddle link: http://jsfiddle.net/n5s53v32/6/

This is my HTML:

<table>
 <tr>
  <td>td 1</td>
  <td>td 2</td>
  <td class="last">td 3</td>
</tr>
<tr class="bg">
 <td>td 1</td>
 <td class="hide">td 2</td>
 <td class="last">td 3</td>
</tr>
<tr>
 <td>td 1</td>
 <td>td 2</td>
 <td class="last">td 3</td>
</tr>
</table>

Here is my CSS:

.bg{background: red; }
.hide{visibility:hidden; }

In Chrome browser, if child cells (td) of a tr are set invisible, then the background color of the parent tr in the invisible portion does not work. However, it works fine in Firefox.

Edit: The JS fiddle has been updated and can be viewed here: http://jsfiddle.net/n5s53v32/11/

Answer №2

Here is a different approach to try: Code Demo

.hidden{
    /* display:none; */
        visibility:hidden 
}

experiment with visibility

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

Expanding the CSS Search Box

Visit the link I've been working on coding a CSS text box. When you hover over the button in the provided link, you'll notice that the 'Type to search' functionality is working smoothly as it moves to the right. My current focus is on ...

Achieving 10 touchdowns within a set of 5 plays during a football game

Receiving a page from an external site where I have no control. The table structure is as follows: <table><tbody> <!-- headers --> <tr><td></td> <td></td> <td></td> <td>< ...

When using jQuery's .each method, only the final JavaScript object element is added to the divs

I have a unique set of dynamically-created divs, each containing a Title. When a div is clicked, a modal opens (which is cleared upon click), and the Title is displayed again in the modal. My goal is to add the category descriptions into these modals, but ...

Connecting a CSS file with an HTML document

Having an issue with my CSS. For instance, here is a snippet from my CSS file .readmore { font-style: italic; text-decoration: none; color: #509743; padding-left: 15px; background: url(../images/more.png) no-repeat 0 50%; } .readmore: ...

How to center an image within a div without it moving

I have set up a JSFiddle for reference: http://jsfiddle.net/AsHW6/ My task involves centering the down_arrow.png images within their respective div containers. I have successfully centered the up_arrow.png images using auto margins. These images are posit ...

Spans are not creating hyperlinks within anchors

Check out the full code. Here's the relevant code snippet: <a href='http://app.bithumor.co/report_post?id=568'><span class='report_icon'></span></a> Using CSS: <style> .report_icon { width: 60p ...

jQuery fails to recognize response

Can anyone figure out why my alert isn't functioning correctly? <script type="text/javascript"> function SubmitForm(method) { var login = document.form.login.value; var password = document.form.password.value; ...

Is Jade used for making subsequent lines children of an included partial?

Recently, I've encountered an issue with a basic jade layout. Here is an example: include test.jade #bar hi In the test.jade file: #foo hello No matter what I try, the #bar element always ends up as a child of #foo. <div id="foo">hello &l ...

Mentioning VARs found on additional pages

I'm currently designing a website. At the moment, I have set up the site to prompt users for their name on the landing page and store it in a string variable. var username = ""; Once users enter their name and click "Enter Site," they are directed ...

"Position centrally on the inside, using flexbox to fill the entire

Seeking assistance with aligning the text in the center of the flexboxes so that the h4 and p elements in the large box are centered within their respective boxes, as well as ensuring the text in the two smaller boxes is also centered. Any help would be gr ...

Maximizing Particle Performance Using JavaScript

I am experimenting with creating particles in JavaScript for the first time, and I'm unsure if the code below is optimized. When I generate 100 particles on the screen, there isn't much of an FPS drop noticeable. However, when multiple clicks o ...

Is there a way for me to automatically retrieve lost data following a POST request?

Is there a way to automatically retrieve data from the server after submitting a form via POST in the browser? I have an HTML form The form's data is sent to a PHP function like saveRecord() The PHP code stores the data in a MySQL database If the da ...

Excessive greed in 2 column layout is causing left alignment issues

Check out the sample code here: http://jsfiddle.net/YUhgb/ HTML Markup <html> <body> <div class="left"></div> <div class="right"> <div class="container"> <div class="i ...

What is the best way to ensure that a parent element with a nowrap property can inherit the width of

It's proving difficult for me to make a parent element inherit the width of its children. Here is the link to the jsfiddle http://jsfiddle.net/4mk3S/ Currently, I only have an outer div with white-space: nowrap; and child divs with display ...

Placing the date of each blog post at the end of the excerpt

Currently, there is a grid section on the homepage of our site showcasing the two most recent blog posts. I am looking for a Javascript solution to relocate the date to the bottom of each block, outside of the border. For reference, you can visit the follo ...

Linking Background Images in HTML

Is there anyone who can provide assistance with this question? I am looking for a solution where I can have a link with a background image, placed in a row within a table. Your help would be greatly appreciated. Thank you ...

Send a bundle of data through AJAX requests

An issue has been encountered on an HTML/PHP page named sucessful.php where a variable job_id passed from another page is not being received by the destination page interview.php. The problem arises when attempting to transfer two variables and their corr ...

Troubleshooting issues with the Bootstrap4 navbar toggle functionality

Having some trouble toggling the navbar button. It's not working as expected - when I click on it, the toggle background appears and disappears immediately. Here is my code snippet along with a link to the Fiddle file: https://jsfiddle.net/85uyhbv6/ ...

Place a div element immediately following a table row in the HTML document

Welcome to my hotel and cabin availability page! I've created a PHP query that displays the available hotels and cabins in a table format. However, I want to enhance the user experience by displaying a Google Maps location and some pictures of each ho ...

Issue with CSS: 200vw not scaling correctly for mobile devices

I'm attempting to create a horizontal slide effect between two div elements, so here is the HTML code: <div id="container"> <div class="viewport-1"> <div class="inner-div"> <h1>Viewport background 1</h1></ ...