What is causing the background image CSS to malfunction?

I'm having trouble figuring out why the egg image isn't displaying.

Here is the code that's being used:

.header {
    background: 
    linear-gradient(180deg, rgba(0, 0, 0, 0.92), rgba(54, 54, 54, 0.5) 39.24%, rgba(28, 28, 28, 0.4)), 
    url("/img/eggs.jpg") center center / cover no-repeat;
    color: #FFF;
}

Website : Github : https://github.com/fawraw/lefiasco

Thanks !

Answer №1

It seems like the issue could be related to the relative path of the image URL,

When I used a specific image from an online source, everything worked perfectly,

#test{

width : 100px;
height : 40px;
background: linear-gradient(
180deg
, rgba(0, 0, 0, 0.92), rgba(54, 54, 54, 0.5) 39.24%, rgba(28, 28, 28, 0.4)), url(https://1onjea25cyhx3uvxgs4vu325-wpengine.netdna-ssl.com/wp-content/uploads/2020/11/Hello-World_Blog-1536x864.jpeg) center center / cover no-repeat;
    color: #FFF;

}
<div id = "test"></div>

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 align a button within a Jumbotron?

Struggling to find the right CSS placement for a button within a jumbotron. I attempted using classes like text-left or pull-left, but nothing seemed to work as I hoped. I believe a simple CSS solution exists, but it's eluding me at the moment. Ideall ...

Ensuring the same height for two p-cards in PrimeNG

I am facing an issue with ensuring both p-card elements have the same height, where the smaller one aligns to the height of the bigger one. https://i.sstatic.net/Mfnlr.png Is there a way to achieve this using the code below: parent.component.html <di ...

Solving the problem of endless looping in JavaScript tree structures

i have been trying to create a tree structure in JavaScript. However, when I use the add_child function to add a child to an item in the elements array, it adds the child to all items in the elements array and their children, creating an infinite loop. I ...

The vanishing act: Semantic UI menu disappears when you click

My objective is to create a persistent left-side menu using Semantic-UI. I want to implement two different states for the menu - one with text for each item and another with an image for each item. However, I am facing some challenges that have me complete ...

Filled with information provided on the form page

After completing the form and submitting it, I noticed that when I went back to fill out another request, all the fields were already populated with my previous data. How can I reset the form page to have empty values each time? Appreciate your help ...

Using Bootstrap to Implement Special CSS Styles for Various Devices

Is there a way to implement specific CSS rules for different screen sizes using bootstrap? For example, on medium screens (md), can we set an element's left-margin to 10px and have it be 100px on small screens (sm)? Any guidance would be appreciated. ...

Guide to writing the text value " or & in HTML coding

I'm in a bit of a unique situation where I've created some VBA code that does find/replace operations on HTML special character codes. When I try to include this code on my website in HTML format, the parts where my code refers to characters lik ...

Place the collapsible button on the right side of the navigation bar

Looking to position the collapsible button to the right of the navbar in Bootstrap v4, I attempted wrapping the button in: <div class='nav navbar-nav navbar-right'> I also tried adding the float-xs-right class without any luck. A sample ...

We appreciate your feedback regarding the issue with the URL not loading outside the form iframe

I recently added a form to my Wix website using the following code: <script type="text/javascript" src="https://premier.formstack.com/forms/js.php/formname"></script> However, I noticed that the thank you page URL is loading within the form ...

What is the best way to delete an input field once it has been cleared?

After scouring through resources, I found a way to dynamically add input fields on keystroke by referencing an answer from this question. To see my implementation, check out this example. However, one challenge remains - removing a field if the user delete ...

Exploration of the "display: none;" property and loading of content

I am struggling to find concrete information on how "display: none;" affects content loading. I have always believed that certain browsers do not load external resources within content that is styled with "display: none". Is this still inconsistent across ...

The issue with Ajax.BeginForm OnSuccess is that it prevents the CSS transition from functioning properly

Apologies if the title is unclear. In my design, I aim to implement a transition effect when the left or right buttons are clicked. However, the transition does not function as expected because the OnSuccess callback seems to occur before the page is rend ...

Is it possible to add a CSS filter to a background image?

How can I achieve a background image with blur effect using CSS? body{ background-color: transparent !important; background-image: url("img.jpg"); background-size: cover; background-position: center center; background-repeat: no-repea ...

Ensuring Equal Padding on Both Sides of a Div by Setting its Width

In search of a div that houses multiple inner divs with equal padding on the left and right edges. This is crucial for maintaining a fluid layout where the distance between the inner divs and outer div border remains consistent even when the window size ch ...

Several modal windows on a single webpage

On this page I have implemented Bootstrap collapse and modal functionality. The issue I am facing is that when the user clicks on the "Anfrage" button (The yellow button), the modal pops up and works correctly. However, once the modal is closed, the inte ...

Angular: Updating image tag to display asynchronous data

Utilizing Angular to retrieve user profile pictures from the backend, specifically Node.js/Express, has been mostly successful. However, there is one issue that I have encountered. The HTML displaying the profile picture does not re-render when the user up ...

`Why are my overflow-x and flex-wrap not functioning as expected in React JS?`

Having trouble aligning all the movie posters in a single line? It appears that your overflow-x and flex-wrap properties aren't functioning as expected in your App.css. Here's a snippet of your App.css: body { background: #141414; color: ...

Draggable Table Columns with HTML, CSS, and JavaScript

My goal is to create a table in a JSP page that functions similarly to the example shown here. I would like to be able to drag a column of dates within the table and have a form pop up. Can anyone provide guidance on how I can achieve this in JSP? ...

CSS flexbox completely collapses all child elements that are empty

Is there a way to collapse the empty "col" divs in this html structure while keeping the content divs equally sized (two columns in this case)? * { box-sizing: border-box; } .container { border: 1px dashed rgba(255, 0, 0, .5); background-color: b ...

Can you explain the purpose of using "link href="#""?

While browsing through the source code of a website, I came across this interesting snippet. <link href="#" id="colour-scheme" rel="stylesheet"> I'm curious, what exactly does this code snippet do? ...