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

position the input and span elements side by side

Need help aligning an input and a span element next to each other. The span is currently positioned below the input, but I want it to be on the right side of the input. I am trying to create a search bar using this input and span tag, so they need to be al ...

The styling of divIcons in React Leaflet Material UI is not applied as expected

When using divIcon in React Leaflet to render a custom Material UI marker with a background color prop, I noticed that the background style is not being applied correctly when the marker is displayed in Leaflet. Below you can find the code for the project ...

Is it possible to establish a CSS minimum width that is relative to a different element?

Is it possible to set the min-width of a submenu in CSS to be equal to that of the corresponding link in a navigation menu? I am using LESS for my styling. <ul> <li> <a href="">Item FooBarBaz</a> <ul class="submenu"&g ...

Creating a CSS layout with three columns where the first column's width is unspecified and the second

I am looking to create a three column layout with specific width requirements. The first column should adjust based on content, the second column should fill the space between the first and third columns, and the third column should have a fixed width. Add ...

Guide on showcasing jQuery variable values in PHP on a single page

I have some JavaScript and PHP code that I need help with. I want to assign a jQuery variable value to a PHP variable called $nicks, and then echo the value of $nicks on the same page. <script type="text/javascript"> var axel = 131.5678466; < ...

Guidelines for inputting a value into a JavaScript list and choosing a specific item within the list

When it comes to studying Selenium Web, I rely on the website. My current challenge involves inputting 'Ottawa' into the location control and then selecting 'Ottawa, ON'. WebElement el = driver.findElement( By.xpath("//*[contains( ...

YouTube videos cannot be embedded using an iframe on Firefox

I inserted a YouTube iframe code inside a div element. <div id="box"> <iframe width="300" height="315" src="//www.youtube.com/embed/82fn4mcNGJY" frameborder="0" allowfullscreen></iframe> </div> After applying CSS to sc ...

Tips for transferring this text to a new line

I have come across this text that needs to be moved to a new line, This is its current appearance, Here is how I want it to look: HTML code snippet: <div id="content"> <div id="header"> <p> <img class="header-im ...

The drop-down menu appears to be falling behind the 'content' div element

Whenever I try to hover over the dropdown menu, it frustratingly appears behind the content div that I painstakingly created. Despite all my efforts with z-index adjustments, the issue still persists. Below you'll find all the code for my website, but ...

How can a loading bar be shown while a PHP page is loading?

I currently have an HTML form that directs to a PHP file upon submission. The PHP file takes some time to load due to background processes running, so I am interested in implementing a progress bar or alert to indicate when the file is fully loaded. Does ...

Develop a unified help document that is compatible across multiple platforms using an existing markdown file

I have been tasked with working on an existing project that already has detailed functionality and relevant information in a markdown file. My goal is to create a universal help file that can be easily viewed on various platforms including Windows, macOS ...

Stable element placement in relation to its container

While dragging an element, it obtains a position: fixed. This particular element is located within a modal that is directly nested inside the body element. In the image below, the modal appears in gray, while the rest of the body is black, and the button ...

The Tabbed Panel Bug: Incorrect HTML ID Causing Tab Change Issues in Bootstrap

I've been working on a tabbed panel feature for my website. However, I've run into an issue where clicking on the second, third, and other tabs doesn't change the content displayed - it always stays the same. I'm pretty sure I wrote th ...

Attempting to align two distinct divisions next to each other

Here is the updated code snippet: <Grid container justify="space-between" alignItems="flex-start" direction="column" xs spacing={5} style={{ padding: 10, }}> <ParamSelection/> { state.select ...

Adding events to a TinyMCE iframe in WordPress

Recently, I implemented some customized div wrapper styles in Wordpress. However, when utilizing these styles on a page, I encountered difficulties adding content below them. Despite using CSS:after within the divs to generate a selectable area, this metho ...

jQuery - accessing a different class within the object

Let me explain the scenario: I have a website that will delve into 4 different subjects. Initially, I have 4 divs each representing the title of those subjects. For instance, <div><p> Physics </p></div> <div><p> Chem ...

Unique rephrased text: "Amongst a backdrop devoid of white,

In a div with a colored background, I noticed that adding an input element results in an unsightly border. <div class="input-group"> <input type="search" style="height:30px;"> </div> Is there a way to remove this border? ...

Troubleshooting overlap problem between Skrollr and SlickNav

I successfully implemented Skrollr to fix images, similar to this example: Additionally, I am utilizing Slicknav for the menu functionality. However, I encountered an issue where the menu opens behind the fixed "parallax" image. Despite trying various ap ...

Is there a way in CSS to enable caps lock for specific characters only?

After downloading a new font and setting font-variant: small-caps;, I noticed that my numbers appear much larger than the letters. Is there a way to apply small caps only to the letters, not the numbers? While traditionally numbers do not have a capital ...

"Customizing the website's font: A step-by-step guide to replacing the default Roboto font with a custom font

Despite my efforts to globally override the font, I am still encountering instances where the Roboto font is not being replaced, particularly on MUI select and autocomplete components. import { createTheme } from '@material-ui/core/styles'; // A ...