Adjusting the background color of an individual element within a grid using CSS

<div id="56c46f8385953" class="mg_box mg_pre_show col1_3 row1_3 m_col1_2 m_row1_3 mgi_14 mg_pag_1 mg_gallery mg_transitions mg_closed   " rel="pid_14"  mgi_w="0.333" mgi_h="0.333" mgi_mw="0.5" mgi_mh="0.333" >
  <div class="mg_shadow_div">
    <div class="img_wrap mg_has_txt_under" >
      <div>
        <img src="" class="thumb" alt="NYC" fullurl="//testseite24-7.de/wp-content/uploads/ewpt_cache/367x367_85_1_c_FFFFFF_40d34172585f94f3753e12e0e4b051fc.jpg" mobileurl="//testseite24-7.de/wp-content/uploads/ewpt_cache/400x267_85_1_c_FFFFFF_40d34172585f94f3753e12e0e4b051fc.jpg" />
        <noscript>
          <img src="//testseite24-7.de/wp-content/uploads/ewpt_cache/367x367_85_1_c_FFFFFF_40d34172585f94f3753e12e0e4b051fc.jpg" alt="NYC" />
        </noscript>
        <div class="overlays">
          <div class="mgom_layer mgom_full_img_layer mgom_18_0 ">
          </div
            ><div class="mgom_txt_wrap mgom_18_3 ">
          <div class="mgom_layer mgom_descr mgom_18_1">
          </div>
          <div class="mgom_layer mgom_txt_block mgom_18_2">
          </div>
          </div>
        </div>
        <a href="http://testseite24-7.de/#!mg_ld_14" class="mg_seo_dl_link">'</a>
      </div>
    </div>
  </div>
</div>

Greetings fellow members of the community,

I find myself in need of assistance with coding, as my experience is somewhat limited.

Currently, I have a portfolio on my website and I'm utilizing the Media Grid – WordPress responsive portfolio plugin along with the Media Grid Overlay manager add-on. The Overlay Manager only allows for one design to be applied to the entire grid, with the exception of the excerpt feature for each item. However, I am looking to customize the overlay colors for individual items within the same grid (such as NYC). While the developer has mentioned that this customization is possible, they do not offer support in implementing it directly (stating, "However is already feasible, but you need to know CSS and how to inspect code... Each grid item has got an unique selector based on its ID, then isn't particularly difficult to achieve it"). I have identified specific IDs (for example, #56c46f838595 for the NYC Gallery) and the selector (class) for the overlay - in this case, the layer with the changing background color bears the class .mgom_18_0. Despite several attempts to modify the color for a single item, I have been unsuccessful so far. All relevant details are provided below.

Your help in resolving this matter would be greatly appreciated! Thank you in advance!

Warm regards, Mike

UPDATE: Additional HTML content has been added. I now find myself slightly confused as the ID changes every time the page is loaded...

The settings can be tested on the following site:

CSS information pertaining to the overlay type used for the test city grid is included below, followed by an ELEMENT LEGEND for the Plugin. View the Legend Classes Itemshere

/* ***** 18 - test OVERLAY ***** */ 

    .mgom_18_0 { /* full_img_layer */
            top: 0px; left: 0px;
                background-color: #ffffff;opacity: 0; filter: alpha(opacity=0);                 
                transition: all 0ms ease 0s;
                -webkit-transition: all 0ms ease 0s; /* older webkit */
                -ms-transition: all 0ms ease 0s;                    
        z-index: 890; 
    }

    .mg_box:hover .mgom_18_0 {
            top: 0px; left: 0px;
                background-color: #ffb514;opacity: 0.8; filter: alpha(opacity=80);
                        }

    .mgom_18_1 { /* descr */
            text-align: left;
                font-size: 14px;                    
                color: #222222;line-height: 19px;                   
    }

    .mg_box:hover .mgom_18_1 {              
                color: #383838;
    }

    .mgom_18_2 { /* txt_block */
            top: 0px; left: 0px;
                background-color: #ffffff;opacity: 0; filter: alpha(opacity=0);                 
                transition: all 0ms ease 0s;
                -webkit-transition: all 0ms ease 0s; /* older webkit */
                -ms-transition: all 0ms ease 0s;                    
    }

    .mg_box:hover .mgom_18_2 {
            top: 0px; left: 0px;
                background-color: #ffffff;opacity: 0; filter: alpha(opacity=0);                 
    }

        .mg_box .mgom_18_3.mgom_txt_wrap > *:not(.mgom_txt_block) {
            opacity: 0;
            filter: alpha(opacity=0);   
        }

        .mg_box:hover .mgom_18_3.mgom_txt_wrap > *:not(.mgom_txt_block) {
            opacity: 1;
            filter: alpha(opacity=100); 
        }
        .mgom_18_3.mgom_txt_wrap > * {
            transition:         opacity 0ms ease 0s;
            -webkit-transition: opacity 0ms ease 0s;
            -ms-transition:     opacity 0ms ease 0s;
        }

.mgom_18_3.mgom_txt_wrap {
    top: 0px; left: 0px;            
                transition: all 0ms ease 0s;
                -webkit-transition: all 0ms ease 0s; /* older webkit */
                -ms-transition: all 0ms ease 0s;            

}

.mg_box:hover .mgom_18_3.mgom_txt_wrap {
    top: 0px; left: 0px;    
}

Answer №1

Locate a specific line of code within your html document

<div class="mgom_layer mgom_full_img_layer mgom_18_0">

Update the line to include a new style:

<div class="mgom_layer mgom_full_img_layer mgom_18_0" style="background-color: red">

After making this change, remember to refresh the page to see the visual difference. Using an id may be preferred, but this approach can also be effective.

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 we prevent the modal from extending beyond the boundaries of the phone screen when zoomed in

I am currently developing a web application that features a large content page, specifically a map which should display detailed information upon zooming in similar to Google Maps. The interactive elements on my map are clickable, triggering a modal popup ...

Learn how to implement a feature in your chat application that allows users to reply to specific messages, similar to Skype or WhatsApp, using

I am currently working on creating a chatbox for both mobile and desktop websites. However, I have encountered an obstacle in implementing a specific message reply feature similar to Skype and WhatsApp. In this feature, the user can click on the reply butt ...

What is the best way to showcase a table below a form containing multiple inputs using JavaScript?

Context: The form I have contains various input fields. Upon pressing the [verify] button, only the "first name" is displayed. My goal is to display all input fields, whether empty or filled, in a table format similar to that of the form. Exploration: ...

Attempting to toggle the visibility of div elements based on radio button selections

I'm currently working on a script that will dynamically show and hide different div elements based on the radio button selection made by users. The jQuery library is loading correctly, as I have tested it with an alert message upon page load. Si ...

Tips for creating incremental progress on a pop-up page?

I am looking for guidance on creating a page with specific functionalities. Here is what I have in mind: I want to implement a button that opens a popup when clicked. The popup should display static instructions and buttons for the user to progress throu ...

Retrieve_the_term_list function fetches a single term

In my website, I have a custom post type named 'Jobs'. This custom post type includes a custom taxonomy known as 'locations'. My goal is to display the corresponding locations for each job posting on the jobs page. For example, a job l ...

Creating a Contact Form with Email Submission using Html and Php

Establishing Database Connection $server = 'localhost:8080'; $username = 'root'; $password = ''; $database = 'resort'; $connect = mysqli_connect($server, $username, $password ) or die(mysqli_error.&apos ...

Is the parent node of the input element the input element itself?

When working with a DOM object obj of type <input>, I encountered an issue where attempting to obtain its parent node using obj.parentNode resulted in the same obj being returned. Is this behavior specific to <input> objects? What other types o ...

How can you create an accordion menu that expands when a button is clicked?

Is there a way to make an accordion menu open when the 'More' button is clicked? I've tried, but it always starts in its expanded state and collapses when the button is clicked. What I really want is for the accordion to be closed initially ...

I believe the term for this is an inline text alignment: center, but for some reason, I am unable to make it function properly within

Can anyone help me align the "Sizes" section in the center? I've tried everything but can't seem to get it right. Any tips on what and where to insert in the code? Thanks! <form action="https://www.paypal.com/cgi-bin/webscr" method="post" ta ...

How do you prevent items from shrinking in a flex container when they have more content?

I am facing an issue with a flex container where the items are set in a row. Once it reaches the end of the viewport width, I want it to overflow-x: scroll. However, instead of enabling scrolling, all items shrink when more items are added to fit the scree ...

Display the modal in Angular 8 only after receiving the response from submitting the form

I am encountering an issue where a pop-up is being displayed immediately upon clicking the submit button in Angular 8, before receiving a response. I would like the modal to only appear after obtaining the response. Can someone assist me with achieving thi ...

Challenges arise when using Bootstrap 4 for country selection

There have been reports that bootstrap 4 country select is not functioning properly. In an effort to troubleshoot, I delved into the documentation to find a solution. To make bootstrap-select compatible with bootstrap 4, refer to: Bootstrap 4 beta-2 ...

submitting two contact forms using ajax

Looking to enhance my knowledge of form design... Hello there! I'm currently working with two contact forms on the same page, both utilizing ajax for submissions. Each form functions properly when standalone, but as soon as I integrate them togethe ...

Attempting to alter the background image through the action of clicking on an image using jQuery, HTML, and CSS

I have created custom weather icons like a sun, cloud, and rainy cloud using Photoshop. My goal is to allow users to click on these icons and change the background image of the website's body. However, despite my efforts, clicking on the images does n ...

I noticed that my CSS style sheet is only working on three of my pages. What should I do to make sure it affects the fourth page as well?

I am currently facing an issue with my website where I have linked one .css stylesheet to 3 different pages. This is just a temporary template until I finalize the individual look of each page. After performing some div positioning on the site, most pages ...

Switching the checkbox value upon clicking a div element

One challenge I am facing is with a checkbox that saves its value and title in the local storage when clicked. This checkbox is located within a div, and I want the checkbox value to change whenever any part of the div is clicked. Despite my efforts, I hav ...

Having issues with the input event not triggering when the value is modified using jQuery's val() or JavaScript

When a value of an input field is changed programmatically, the expected input and change events do not trigger. Here's an example scenario: var $input = $('#myinput'); $input.on('input', function() { // Perform this action w ...

Looking to achieve a mouse over effect in jQuery?

For the past few days, I've been grappling with a question that I just can't seem to find the right answer to. I'm trying to create a mouseover effect similar to the one on this template (the Buddha at the top of the page). Despite my best e ...

Adding a Video as a Background Button Using HTML and CSS

My attempt to utilize background-image in CSS for the button background was unsuccessful as it only supports images, not videos. Is there a way to set a video as the background of a button? My goal is to create a button with a continuously looped muted v ...