The background color disappears when viewed on mobile devices

I have created a table using HTML and CSS. The issue is that the background colors of the table display correctly on a desktop, but on a mobile phone, they appear completely transparent while the text remains visible.

I am using Bootstrap 4 for this website, and I have tried using the !important tag to override CSS styles, but the problem persists.

Here is the CSS code:

#beatsTable tr {
    background-color:rgb(123, 126, 132, 1) !important;
    padding:10px;
    padding:10px;
}

#beatsTable tr:not(:nth-child(2)):hover {
    background-color:rgb(55, 56, 58, 0.5);
}

#beatsTable td {
    color:gray;
    padding:10px;
    color:white;
}

#beatsTable th {
    padding:10px;
    background-color:rgb(17, 17, 17, 0.5);
    border-bottom:1px solid rgb(46, 204, 57, 0.5);
    border-top:1px solid rgb(46, 204, 57, 0.5);
    font-size:15px;
}

Here is the HTML code:

<table style="color:white" id="beatsTable">
  <tr>
    <div class="musicPlayerContainer">

    </div>
  </tr>
  <tr>
    <th>Title</th>
    <th>Time</th> 
    <th>Bpm</th>
    <th></th>
  </tr>
  <tr>
    <td>Name1</td>
    <td>3:12</td> 
    <td>120</td>
    <td><div class="buyBtn" data-toggle="modal" data-target="#purchaseModal">Buy</div></td>
  </tr>
  <tr>
    <td>Name2</td>
    <td>4:20</td> 
    <td>153</td>
    <td><div class="buyBtn" data-toggle="modal" data-target="#purchaseModal">Buy</div></td>
  </tr>
  <tr>
    <td>Name3</td>
    <td>6:09</td> 
    <td>100</td>
    <td><div class="buyBtn" data-toggle="modal" data-target="#purchaseModal">Buy</div></td>
  </tr>
</table>

View the table on desktop: http://prntscr.com/jtud8h

View the table on mobile: http://prntscr.com/jtudjt

Answer №1

Perhaps the issue lies in your attempt to apply an alpha value of 1 or 0.5 to the background. To make it work, you need to use rgba instead of rgb

I trust this explanation clears things up!

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 can I effectively display a blank menu item for the SelectField component in Material-UI within a React application?

I am using the select-field component from the material-ui framework version 0.15.4 with React version 15.4.0. I am attempting to add a blank menu-item to the select-field in order to allow for deselecting a value in the dropdown field when clicked. Howeve ...

Ways to incorporate JavaScript code within Reactjs

I am currently working with Reactjs and using Nextjs. I am facing a challenge regarding integrating "index.html" with "index.js". At the bottom of "index.html", there is some JavaScript code that I need to transfer to another file. Can you advise me on w ...

Show different JSON data based on the existence of another key in Javascript

Having recently started learning JavaScript, I attempted the code below but couldn't quite get it to work. Despite consulting various resources, I still wasn't successful. Desired Output: To check if AUTO damage is present in the data. If so, re ...

Can you explain the process of retrieving API information from a component directory with Next.js?

In the components folder, I have created a reusable component that displays user details for those who log into the system in the header section. Currently, I am attempting to utilize getInitialProps with isomorphic-unfetch. static async getInitialProps( ...

The SVG image exceeds the boundaries of the parent column div in bootstrap

I am struggling to make a SVG fit inside a column in a bootstrap div with col-lg-4. I tried using img-fluid, but it did not work as expected. The SVG should automatically adjust its size to fit the parent div. However, that is not happening. .star-ratin ...

Substitute the temporary text with an actual value in JavaScript/j

Looking to customize my JSP website by duplicating HTML elements and changing their attributes to create a dynamic form. Here is the current JavaScript code snippet I have: function getTemplateHtml(templateType) { <%-- Get current number of element ...

Ensure the filelist resets each time the bootstrap-modal is hidden or closed

Context I am in the process of developing a form where users can input data and upload an image file. The information entered into the form, along with the file name, is stored in a MySQL database. To style the website, I am utilizing Bootstrap. When a u ...

What is the best way to connect to a JSON key that is consistently returned with a varying or unpredictable name?

I am currently working on an Angular 4.x application where my goal is to showcase a random Wikipedia article. Each time I check the JSON data in Chrome Dev Tools under query/pages, I notice that the pageID always has a different number. The structure of th ...

Tips for updating a reactive form with multiple layers of nested JSON values

I am tasked with retrieving and working with the data from a deeply nested (potentially infinite levels) reactive form that includes formArrays, formGroups, and formControls. This data is stored in a database. Currently, my approach involves patching the ...

Listening on TCP port for HTML5 Websocket communications

I have a desktop application that is communicating with my asp.net mvc app. The desktop application publishes data on port:10000 which I need to be able to listen to in the browser. Below is the code snippet: <html> <head> <s ...

When moving to a different page, PHP seems to have a problem keeping the session values in place

As I work on my PHP application, I encounter an issue with maintaining session values. In this scenario, I have two files: 'sidebar.php' and 'home.php'. The sidebar is included on the home page, and it contains login controls. Logging i ...

Update the content of a div element without having to fetch an external file

I have a question regarding using JQuery with PHP and MySQL. Here's the situation: I have a div that displays a user's points, but the points change due to various actions on the website. I've come across many scripts that use external file ...

Creating a CSS key animation for resizing an image: What is the correct way to make an image expand and contract

Check out this CSS key animation example: http://jsfiddle.net/ryurage/Q2ELp/ I'm attempting to make an image grow and occupy most of the window when triggered by user interaction like hovering or click-and-hold. Subsequently, I want the image to shr ...

Combining audio and video streams in Node.js

I'm currently developing a YouTube video downloader using the ytdl-core library. However, I've encountered an issue where it cannot fetch high quality videos with audio because they are stored in separate files on YouTube. My goal is to download ...

Transitioning to the Full Website with PHP Sessions - Discrepancies in Styling

I've encountered an issue when trying to switch from a mobile site to a full site using sessions. The styles on the full site do not load unless I refresh the page, at which point they finally appear. On my mobile page, there's a link that direct ...

In Angular, encountering difficulty accessing object members within an array when using custom pipes

Here is a custom pipe that I have created, but I am facing an issue accessing the members of the customfilter array, which is of type Item. import { Pipe, PipeTransform } from '@angular/core'; import {Bus} from '/home/pavan/Desktop/Pavan ...

jQuery fails to function properly when using the .live("keyup") event

Below is the code snippet: $(document).ready(function() { $("#querybox").live("keyup", function(e) { var code = (e.keyCode ? e.keyCode : e.which); if (code == 13) { $("#querybox").blur(); } else { search(document.getElementB ...

How can I make sure that my function returns a mutated object that is an instance of the same class in

export const FilterUndefined = <T extends object>(obj: T): T => { return Object.entries(obj).reduce((acc, [key, value]) => { return value ? { ...acc, [key]: value } : acc; }, {}) as T; }; During a database migration process, I encounte ...

What is the process of invoking an external JavaScript function in Angular 5?

I recently downloaded a theme from this source. I need to specify script and CSS in the index.html file. The body section of index.html looks like this: <body> <app-root></app-root> <script type="text/javascript" src="./assets/js ...

Steps to eliminate the select all checkbox from mui data grid header

Is there a way to remove the Select All checkbox that appears at the top of the checkbox data column in my table? checkboxSelection The checkboxSelection feature adds checkboxes for every row, including the Select All checkbox in the header. How can I ...