Is it not possible to apply CSS box-shadow to divs on top of an image or video

Why does the box shadow on my content divs not mix with my superbgimage/jw player background? Instead of darkening, it creates a grey halo effect. Do box-shadows only work on white backgrounds?

Halo effect instead of shadow blending with background image

CSS for superbgimage background and jQuery Isotope plugin divs

#background {
    background: inherit;
    }

#superbgimage {
    display: none;
    }

.item {
    margin-bottom: 4px;
    -moz-box-shadow: 3px 3px 5px 6px #ccc;
    -webkit-box-shadow: 3px 3px 5px 6px #ccc;
    box-shadow: 3px 3px 5px 6px #ccc;
    }

Divs for background

<fieldset id="background">
    <a href="media/background_0.jpg"></a>
    <a href="media/background_1.jpg"></a>
    <a href="media/background_2.jpg"></a>
    ...
</fieldset>

<div id="superbgimage"></div>

Script for background

<script type="text/javascript">
$(document).ready(function () {

$.fn.superbgimage.options = {
    preload: 1,
    randomtransition: 0,
    slideshow: 1,
    slide_interval: 9000,
    randomimage: 1,
    speed: 3000,
    transition: 1
};

$('#background').superbgimage().hide();

});
</script>

Answer №1

To ensure compatibility across different browsers, it is important to implement a cross-browser solution such as the following:

.shadow {
-moz-box-shadow: 0 0 5px #888;
-webkit-box-shadow: 0 0 5px #888;
box-shadow: 0 0 5px #888;
}

Answer №2

It's a good idea to switch from HEX colors to RGBA. With RGBA, you can adjust the opacity of the color, allowing the background to show through.

For example:

rgba(0,0,255,0.5)

Also, consider using an online CSS3 element generator for more complex elements like box-shadow. It takes the guesswork out of creating these elements:

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

Adjust size of background image to fit within ie8 window dimensions

Currently, I'm facing an issue where a Drupal 7 module is used to load a background image, but CSS3 resizing is not supported in IE8. background-image: url('image.jpg'); background-size: cover; I have tried conventional methods like placin ...

The navigation bar vanishes as soon as I click the Modal button

I am experiencing an issue where the Navbar disappears when I open a modal while using Bootstrap. Navbar before opening Modal https://i.stack.imgur.com/Oo9qb.png Navbar after opening Modal https://i.stack.imgur.com/dlK1V.png <script src="https:// ...

Utilize Flexbox to create a layout with 3 divs, organized into two columns where one column

I am attempting to transform <div></div> <div></div> <div></div> Three consecutive divs into the following format. Div 1 is red, div 2 is green, and div 3 is blue. I have achieved this using floats, like so: .div1 { ...

The collapsed button on the Bootstrap 4 accordion flickers slightly as it expands, not reaching its full expansion

I'm currently working on implementing an accordion feature. I found inspiration from this component here on fiddle which utilizes bootstrap 4. While attempting to troubleshoot a bug in the SO forum, I noticed that on my page, the component seems to "b ...

Unable to implement active class on parent li tab when child li is clicked

<div class="header_nav"> <ul id="navigation"> <li class="dropdown"><a href="#" rel="external">mainTab1</a> <ul class="sub_navigation"> ...

Triggering scroll snapping in CSS based on a different user action than just scrolling

Take a look at this example: https://codesandbox.io/s/spring-wood-0bikbb?file=/src/styles.css Try this to recreate the issue: Click on the input at the top Scroll to the bottom, then click on an empty area Observe how the screen jumps back up to the top ...

My custom class is adding the Bootstraps class

Dealing with multiple tables of the same size can be a hassle when adding individual classes to each one. Is there a way to apply multiple Bootstrap classes to one class in the stylesheet? For example, using <table class='table table dark> curre ...

Create a circle at the point where two table cells intersect in an HTML document

How can I create a circular shape at the intersections of HTML tables? I am struggling to figure out a way to incorporate shapes into HTML tables. My goal is to achieve a design similar to the image shown below. I have attempted using text and spans, as we ...

The sudden disappearance of the vertical scrollbar in an absolutely positioned element

UPDATE : Added link to the example: http://jsfiddle.net/bfNzH/1/ This is how my HTML structure looks: <body> <div class="wrapper"> <div class="left">left bar</div> <div class="right"> < ...

Having trouble with Jquery's Scroll to Div feature?

When I click on the image (class = 'scrollTo'), I want the page to scroll down to the next div (second-container). I've tried searching for a solution but nothing seems to work. Whenever I click, the page just refreshes. Any help would be gr ...

Utilizing Jquery to pass two classes along

I am looking for assistance on how to pass multiple classes within if-else statements and jQuery. My goal is to have both divs and divs2 change when the next button is clicked. Can someone please provide guidance on achieving this? --code not mine-- ...

retrieve the data-task-IDs from the rows within the table

I am currently working with a table that looks like this: <table id="tblTasks"> <thead> <tr> <th>Name</th> <th>Due</th> ...

Scrolling through content can reveal multiple sticky elements that remain aff

I have header and sidebar div blocks and I need them to stick at the top once the scroll event is triggered due to our specific requirements. While making a single element sticky is not a problem, having more than one causes issues with scroll action and ...

Incorporate a button into an input element

I have a created a custom login form and I'm trying to add a "FORGOT?" text/button next to the password field. If you want to see an example, visit this website and click on the login button: <script src="https://stackpath.bootstrapcdn.com/boot ...

What steps can be taken to resolve the problem of CSS sprite causing blurry images on mobile devices when using background-position?

In the world of CSS, working with regular images is usually straightforward - setting the width to 50px will display them perfectly on both desktop and mobile devices without any issues as long as the image quality is good. However, when it comes to using ...

Creating dynamic height children with Flexbox in React Native

I am relatively new to using Flexbox, Exponent, and React Native, so I'm not entirely sure if I am implementing this correctly. Any assistance you can offer would be greatly appreciated, and I have included a snack below that could serve as a starting ...

Is it possible to smoothly transition from one background image to another in CSS or JavaScript?

Most tutorials I've come across suggest using a background image with a linear gradient overlay, but that solution doesn't suit my needs: I have two adjacent divs with background images, slightly overlapping by 50px. I wish to create a gradient ...

What changes can I expect if I switch from inline to block display for a table?

Why are border-spacing and border-collapse still working even when I set the display property of the table element to block? I thought these properties only worked when the display was set to table, but it's still functioning. Why is that? I didn&apo ...

Enhance the appearance of a row on the table with a lumin

Is there a way to create a glowing effect around a single row in a table, similar to the style shown in this example? Here's the code that can help achieve this effect, sourced from CSS/HTML: Create a glowing border around an Input Field .glowing-bo ...

Using Javascript to update various element styles using their corresponding IDs

I am currently working on implementing a dark mode feature and I am encountering an issue when trying to change the CSS of multiple elements at once. This is my JavaScript code: var elem = document.getElementById('fonts'); for(var i= ...