Add a subtle shadow effect to enhance a header image

Struggling to add a shadow effect to the header image on my website.

Website URL:

I've attempted the following CSS code:

.wsite-background
{
  box-shadow: 0px 10px 5px #888888;
}

Adding a shadow effect is usually straightforward for me, but this time it's not cooperating.

Appreciate any help. Thank you.

Answer №1

The box-shadow effect on your element is currently being hidden by other elements that come after it, specifically #main-wrap. To make the shadow visible above these elements, you can adjust the z-index property of your element.

In order for the z-index to take effect, you will need to change the positioning of your element from static to something else:

.wsite-background {
  box-shadow: 0px 10px 5px #888888;
  position: relative;
  z-index: 1;
}

Answer №2

If you want to use a background image, make sure to apply the inset property along with either relative or absolute positioning.

Here's an example for you to try:

.custom-background{
   position:relative;
   -webkit-box-shadow: inset 0px 10px 5px #888888;
   -moz-box-shadow: inset 0px 10px 5px #888888;
   box-shadow: inset 0px 10px 5px #888888;
}

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

What is the best way to insert a character (::before) before an element?

I am trying to add a circle/dot using ::before on an element. • • However, I cannot seem to make it visible! .line ::before{ content:'•'; } and .line ::before{ content:'•'; } (Still not showing) I ...

Text: The character code "f068" is displayed as "?"

I need to retrieve the content value from my pseudo element. script = "return window.getComputedStyle(document.querySelector('small.fa.text-muted.fa-minus'),':before').getPropertyValue('content');"; js = (JavascriptExecutor) ...

In CSS3, what is the significance of placing a comma between transition and transform?

Just getting started with CSS3 and have a couple of questions: 1) I know that using -XXX-transtion: opacity .4s tells Webkit and Firefox browsers to gradually change the opacity to zero over 400ms. However, what does the comma right after signify? opaci ...

Implementing the class "col-xxl" is creating additional padding within the fluid container in Bootstrap

After playing around with the bootstrap grid system, I ran into a problem with the "col-xxl" class. Can anyone help me figure out why this issue occurred and how to fix it? <style> [class*="col"] { padding: 1rem; background ...

How can I line up elements in different divs when the width is adjusting based on the window size?

Trying to align a search input and a result element in separate containers when the window size changes. Looking for a solution without using Javascript. One window size: https://i.sstatic.net/LiQtY.png A smaller window: https://i.sstatic.net/dgj4I.png C ...

Prevent click event from bubbling up in React and DOM event mix situations

We are offering a menu here. In case the menu is visible, users should be able to close it by clicking anywhere on the screen: class Menu extends Component { componentWillMount() { document.addEventListener("click", this.handleClickOutside) ...

Ways to avoid divs overlapping on a mobile device?

If you visit this page: The recent searches section displays correctly on a computer, but it overlaps with the footer when viewed on an iPhone 6. What steps can I take to avoid this issue? ...

"Upon entering text into input fields, the css attributes are reset and lost

My HTML table contains cells <table id="grid"> <tr> <td><input type="text" id="1" /></td> <td><input type="text" id="2" /></td> ...

The static files are being received by Django but are not functioning properly

I've been working on a project using django 1.7, and below is my settings.py configuration: STATIC_URL = '/static/' STATICFILES_DIRS = ( os.path.join(BASE_DIR, "assets"), ) STATIC_ROOT = "absolute/path/to/static" In the 'assets&apo ...

Conceal the vertical scrollbar while enabling scrolling functionality on Firefox, Internet Explorer, and Edge browsers

Although this issue has been addressed multiple times, I am still unable to find a solution that works for me. The scrollbar continues to appear on Windows OS browsers such as Firefox, Edge, and IE. Please note: I do not want to adjust padding or margins ...

Bootstrap 4: Concealed and Revealed Columns?

Is anyone else experiencing an issue where xs is hidden in xs views? I have a hunch it might be due to changes in Bootstrap v4, but I'm curious if there's a way to still make it work without delving into the CSS. My current setup uses the default ...

Adjusting the width of titles in a CSS menu upon hover

I am currently creating a basic CSS menu. However, I am facing an issue where selecting a menu title in the menu bar causes the width of the title to extend to match the width of the associated menu, which is not my desired outcome (the title's width ...

What strategies can I employ with flexbox to achieve my design goals?

How can I achieve my design requirements using flexbox? design requirements The current code that I have implemented follows the flexbox approach to meet the design requirements. However, the output of this code does not match the screenshot of my design ...

Tips for aligning a div to the top of a different div

Located within the content div is the first div known as the '#icon-selection-menu' bar. Its default position is set to absolute with top:0px and left:0px, causing it to appear in the top left corner of the content div. Further down within the c ...

Replace the css variables provided by the Angular library with custom ones

Having an angular library with a defined set of css variables for colors applied to components, which are globally set like this: :root { -color-1: #000000; -color-2: #ffffff; ... } In my application utilizing this library, I need to override ...

Adjust Navbar Header Color Based on Screen Size

I am completely new to front-end development. I am in the process of building my own responsive website using Bootstrap 3. One issue I am facing is that when I resize my browser window to simulate a phone screen, I want the navigation bar color to change ...

The Bootstrap navbar does not collapse as expected

Upon opening my HTML file, I am unable to locate the collapse button on the navbar. The collapsible button seems to be missing. Here is a snippet of my HTML code: <!DOCTYPE html> <html> <head> <title>BoostUp - Boost your ...

Widgets that opt for an <h3> for their title instead of the usual <h2>

(personal website) In my current theme, the widgets are displayed below the slider. For example, Rainy Day Promotion, Raves, etc. I would like all the titles to be shown as <h3> tags instead of <h2>. If anyone can provide me with guidance on ...

Ways to rearrange items in the navigation bar?

I am working with a Bootstrap template and I am trying to adjust the layout to be right-to-left (RTL). Currently, when I set the site title to RTL in the navbar, the buttons in the navbar also switch to RTL alignment. This is not the desired layout I want. ...

Problem with child divs escaping outside the boundaries of the parent div

I'm encountering an issue with my HTML/CSS code. I have a parent div called "secClass" which contains two child divs - secClass1 and secClass2. The problem is that the content within the child divs is not staying contained within the parent div. Can y ...