Creating color blends in CSS using overlapping layers

In my HTML structure, I have a div with the class "box" and I have utilized pseudo-classes :after to create a blue border around the box and :before to overlay an orange-colored box as shown in the image. I've achieved everything in the image - the box, the icon, and the text - except for the silver color effect on the text and the icon.

Expected Outcome

https://i.sstatic.net/ISgTU.jpg

Result Obtained

https://i.sstatic.net/HDpGz.jpg

HTML Structure

enter code here
<section class="section why-us">
     <div class="container">
        <div class="box left bordered-box selected">
            <img src="images/why-us-icon8.png" class="section-img">
            <h2>Online Research</h2>
        </div>
    </div>
</section>

CSS Styling

.why-us .box{
            background:#F1F1F1;
            margin-bottom:30px;
            height:250px;
        }
        .bordered-box h2{
            color:#2c3e50;
        }
        .bordered-box:before{
            content:'';
            position:absolute;
            top:10px;
            left:10px;
            width:90%;
            height:90%;
            border:2px solid #B2E9F1;
            z-index:1;
        }
        .selected:after{
            content:'';
            position:absolute;
            top:107px;
            width:260px;
            height:142px;
            background:#E67E22;
            background:rgba(255,140,0,0.4);
            opacity:0.9;
        }

Answer №1

One potential solution is to modify the properties using CSS when hovering over the container. However, I am uncertain if changing the colors can be achieved by positioning an absolutely positioned orange-colored container that transitions over these elements...

If possible, could you kindly provide your code for further clarification?

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

Flexbox does not support sub-columns

I'm having trouble integrating these two columns along with their sub-columns. I have to resort to using this structure instead: <div class="custom_classes"> <div class="custom_classes">col1</div> <div class=&q ...

Scrolling in Bootstrap 4 Cards conceals the fixed Header

Here's some HTML code featuring Bootstrap 4 elements. It showcases a fixed Header and Footer with scrollable Bootstrap Cards in between. When scrolling, the Headers may be hidden by the Cards. How can you adjust the layout so that the Cards scroll "be ...

Increase the size of the Iframe tag to a larger scale

Can someone help me figure out how to make my iframe content fill the entire screen? Any assistance would be greatly appreciated. Photos: Current Output: Desired Output <!DOCTYPE html> <html lang="en"> ...

One cool CSS trick: altering a div's background color with hover!

I'm working on creating a div that acts as a link to another page. My goal is to have the entire background color of the div change to blue when someone hovers over it. I want to achieve this effect using CSS only, as I am not sure if javascript will ...

Display sibling element upon hovering with AngularJS

Within a single view, I have multiple instances of repeated content elements. Each content element contains an anchor element. My goal is to toggle a class on a sibling element within that specific content element when a user hovers over the anchor. For c ...

Issues with transferring object data from JavaScript to a Web API

I am facing issues while attempting to transfer a file from my local machine to SharePoint using JavaScript to ASP.NET MVC Web API call. I continuously encounter errors such as Type error, resource not found, etc. Is there anyone who can provide assistance ...

Scrolling Bootstrap tabs

Here is the code snippet provided below: JavaScript: var hidWidth; var scrollBarWidths = 40; var widthOfList = function(){ var itemsWidth = 0; $('.list li').each(function(){ var itemWidth = $(this).outerWidth(); itemsWi ...

Issue encountered during deployment of React on an express server

After successfully creating a simple React website and Express server, I encountered an issue when trying to deploy the website on my own server. While the scripts, CSS, title, and favicon all seem to be loading correctly, the actual content is not display ...

Unable to access .php file on new server using JQUERY AJAX .get

After migrating my website to a new server, I encountered an issue where all the $().get("whatever.php") calls were failing. Previously, everything was functioning properly but now none of the requests are even reaching the php script. For instance: inde ...

What is the best way to avoid overflow of a fixed element when styling with CSS?

I need help ensuring that the inner div, colored red, stays hidden within its parent div, which is blue. I attempted to use overflow: hidden; in CSS but it did not have the desired effect. I am looking for a solution using solely CSS since JavaScript cause ...

Updating comment content using Ajax

I am in the process of using Ajax to insert my comment content. However, I seem to be facing some issues with the comment_add.php page. I was hoping someone could review it for me. While I have successfully obtained the streamid as checked in firebug, no ...

The unitPngFix plugin ensures that the display of hidden div elements cannot be altered

I have been trying to resolve an issue with PNG files and transparency in IE browsers on my website. I have made progress, but there seems to be a problem specifically with IE6. To display transparent PNG images correctly on my site in IE browsers, I am u ...

Having trouble getting the HTML5 Video to play using the AngularJS ng-src tag?

There seems to be an issue with AngularJS ng-src not working properly with the HTML5 Video element in this specific fiddle: http://jsfiddle.net/FsHah/5/ Upon inspecting the video element, it appears that the src tag is correctly filled with the appropriat ...

Tips for saving and editing a file with JavaScript

I need a website visitor to input text into a text area on my site. When they submit the form, I want the entered text to be saved in a .txt file located in the same directory as the current web page. I am unsure of how this can be accomplished, and if i ...

Mobile FPS suffering due to slide-out drawer performance issues

My application features a drawer menu that functions smoothly on desktop, but experiences issues on mobile devices with noticeable lag. Within the header, I have implemented a boolean value that toggles between true and false upon clicking the hamburger i ...

The HTML form input allows users to input multiple answers for each field

I am struggling with how to phrase this question properly, but I will do my best. Currently, I have a form that collects information about users' employment history. The structure of my form is as follows: <form name="EmploymentHistory" action="Fo ...

What are the steps for adding a photo to the folder directory on my hosting server?

Hey there! I've been having some trouble uploading a photo from my website to the hosting server's directory (/public_html/upload/) using php. No matter what I try, the folder remains empty. I'm stuck and not sure where I'm going wrong. ...

How can I ensure that the images span the entire width of the page in ResponsiveSlides?

I am trying to make my images occupy the entire width of the page just like in this example: However, I have not been able to find a property for this. I'm new to using Jquery but I have a good understanding of Javascript Can someone please help me ...

Is the scroll navigation bar transparent on the right edge?

Below is an image attachment showing a navigation bar with list items. The overflow-y property allows scrolling to the right and left, and the desired effect is to make only one side transparent at a time based on the scroll direction. Is it possible to ac ...

Looking for assistance with aligning the "tape" image on top of another image

I'm attempting to overlay one image on top of another, in order to create the effect of a scrapbook with the images appearing as if they are "taped" onto the homepage. I want to maintain consistency with the tape layer while also allowing myself the ...