The stylesheet link for "contact.css" is unresponsive

I have been reorganizing my website portfolio by categorizing CSS, images, and other files into different folders.

<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/contact.css">

However, I am facing an issue where certain DIV elements from my CSS file cannot be loaded when they are placed inside directories.

One of the problematic DIVs is as follows:

#contact-form-wrap {
    width: 1024px;
    margin: 0 auto;
    background: url('img/form-bg.png')  no-repeat;
    min-height: 768px;
}

Is there a solution to this problem? Everything else loads correctly except for the aforementioned div.

Answer №1

Give this a shot...

#contact-form-wrap {
  width: 1024px;
  margin: 0 auto;
  background: url(../img/form-bg.png) no-repeat;
  min-height: 768px;
}

Answer №2

Ensure that you are utilizing the ID attribute and not a class when referencing #contact-form-wrap. This is the primary issue to keep in mind.

For instance:

Wrong Implementation:

<div class="contact-form-wrap"></div>

Correct Usage:

<div id="contact-form-wrap"></div>

Answer №3

Remember to include type="text/css" in your CSS declaration, as shown below:

<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="css/contact.css">

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

Strip the specified span class from the content within $(this).html()

My search function returns search results in spans. When a span is clicked, a new span with a select input and hidden input is added to another div, allowing all selected features to be posted as an array. I have a question: The $(this).html() now include ...

Apply an image as the background for the body using Bootstrap 5 styling

I'm wondering how I can set the background of the whole webpage (the body) to an image. I'd like to add a subtle fade effect to avoid it being too overpowering. <style> body { background-image:url("{% static 'portfolio ...

Using Jinja2/Python, is it possible to alter the parent's style depending on the child's value?

Initially, I found that the :has() combinator accomplishes my desired outcome. In my HTML, I have a table structured like this: <table class="table"> {% for dict_item in data | sort(attribute='name') %} <tr class=" ...

Is there a way to store image URLs in a fashionable manner?

Hey there! I've been working on creating a HTML page that showcases multiple images. Everything is running smoothly on my localhost, but when I try to access it online, the images take forever to load. Any suggestions on how I can cache image URLs in ...

When the label is clicked, retrieve the value of the checkbox within

I have a checkbox inside a label, and for design purposes, I added a div there. My requirement is to get the checkbox value on the click event of the label. However, I am always getting false whenever the checkbox is clicked. <label class="text-xs col- ...

What is the best way to integrate an admin template into a website without relying on popular CMS platforms like WordPress?

Do I need to use a WordPress system in the backend in order to utilize an admin template? I've noticed that there are several sleek web admin templates available in Bootstrap. I'm interested in using one of them but unsure how to do so without re ...

What is the best way to add an element when a checkbox is selected and delete it when it is dese

How can I display the text of selected elements and remove them when unchecked from a list of orders? When an element is checked, its value is added to the sum and its text is displayed. If it is unchecked, its text should be removed. Click here for the co ...

Website Task Organizer for Effective Online Management

I need assistance with a task management system I am developing for a class project. The system is not functioning correctly as information is getting lost before reaching the server and some PHP code snippets are visible on the website. Can someone please ...

Improprove Google PageSpeed score - must resolve

My mobile website is loading incredibly slow, despite my attempts to improve the speed using Google PageSpeed insights. Unfortunately, I'm having trouble interpreting the screenshot and identifying what changes need to be made. Is there anyone who c ...

Activate the horizontal scrollbar within each flex item when it is stretched beyond its original width

My goal is to have both the child-1 (blue) and child-2 (black) retain their original width when the sidebar appears by enabling horizontal scrolling upon clicking anywhere in the demo below. document.body.onclick = () => document.querySelector(&apos ...

add the closing </div> tag using jquery only

Having a slight issue here, it seems that jQuery is being overly clever. Within my HTML code, I am attempting to insert this string into a div container: </div><div class="something"> You'll notice that the closing tag comes first, foll ...

Loading SVG images in advance

I am in possession of around one hundred simple SVG images, distributed among five different image folders. These images are currently retrieved on demand when they need to be displayed, which generally works well but occasionally results in flickering tha ...

Avoid the ability for individuals to interact with the icon embedded within a button

I'm currently working on a website where users need to interact with a button to delete an "Infraction." The button has a basic bootstrap style and includes an icon for the delete action. <button referencedInfraction="<%= i.infractionID %>" ...

Utilize a jQuery button to horizontally align text with ellipsis

I am currently struggling to align some text with ellipsis horizontally alongside a jquery button and I cannot seem to determine the reason for this issue. You can view my problem on jsfiddle: http://jsfiddle.net/5bVDu/ <span> <span id=&apo ...

A pair of div elements within one section

Can you explain why the following HTML code uses two divs, one with a class and the other with an ID, instead of just using one of them to assign properties? .header { background-image: url("https://s3.amazonaws.com/codecademy-content/courses/web-101/ ...

I haven't quite mastered the art of styling and JavaScript, but I'm currently focused on creating an HTML form with

I attempted to create a button, but it's not functioning correctly. It should display 'Submit', but instead, it just shows a square. Since I haven't learned CSS yet and my online video instructor hasn't covered it either, I need as ...

Choose a tag in order to connect to a different page when an event occurs in Rails

Working on my first complete stack rails application! I am trying to implement a select dropdown menu that will direct users to a specific show page within the app. Each option represents a different college with its own individual show page. I am struggl ...

The body tag mysteriously disappears after the function is called within the $().html() command

As I delve into scraping the source code of a website, I encounter an interesting phenomenon. Initially, when I print out the complete source code, everything appears as expected. However, upon attempting to print an actual DOM, I notice a slight change i ...

Is there a way to eliminate browser-saved password suggestions using Material UI textfields?

"Is there a way to prevent browser suggestions in a Textfield within a form tag so that users must manually type their password without autocomplete options?" "I attempted to use the 'autocomplete="off"' attribute <T ...

What is causing the additional space at the bottom?

Why does my centered black border triangle have an extra bottom margin causing a scroll bar to appear? * { margin: 0; padding: 0; box-sizing: border-box; } body { height: 100vh; width: 100%; background: blue; } .canvas { border: 10px s ...