Skip to main content
Participating Frequently
January 18, 2023
Answered

Problem with correct Background not displaying properly on all pages

  • January 18, 2023
  • 3 replies
  • 606 views

I downloaded a website template that utilizes a style.css to place a particular image for the background image. I replaced the original default image with the image I want it to display.  That is the only code I changed. It works on Two of 20 pages.  The original image has been deleted and is no longer in the image folder. I named the new image a totally new name which i used to change in the .css file.  However, when I first launch the webpages the background flashes with the correct image and then reverts back to the original image that  no longer exists.  I have cleared my brower history but it still only works for the two pages.  

 

Also, please note it is the same for both in Dreamweaver preview and Chrome Browser. I also, tried viewing in Edge and I had the same result. 

 

Here is the new code in the style.css file:

/*MAIN BACKGROUNDS*/
.body_pattern { background:#fff url("../images/Background2.png") repeat top center;/* position:fixed; top:0; left:0; width:100%; height:100%;/**/}

 

I changed from "../images/bg_2.png" to "../images/Background2.png"

 

It works properly on the contact.html page

 

But Reverts back to the original image on the index.html

 

This topic has been closed for replies.
Correct answer BenPleysier

Change as shown

 

 

3 replies

BenPleysier
Community Expert
January 18, 2023

The answer lies in your code. Unfortunately we are not privy to your code until you supply a URL to your site.

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
Participating Frequently
January 18, 2023

I don’t have it published yet as I didn’t want to take the old website down until this one was finished. What is the best way to get you the code?

Brainiac
January 18, 2023
quote

I don’t have it published yet as I didn’t want to take the old website down until this one was finished. What is the best way to get you the code?


By @Melinda27986979mqp5

 

 

Just create a folder on your remote server where your current website exists, upload the files to that folder and provide a link to the file within the newly created folder. Obviously upload any supporting files into the folder as well, like css, image folder etc, basically any files that you have in your local version of the website. Once the problem is established you can delete the folder from your remote  server.

Nancy OShea
Community Expert
January 18, 2023

Did you upload the new CSS file?

Is your index.html page using the same CSS and Template.dwt as other child pages?

 

Nancy O'Shea— Product User & Community Expert
Participating Frequently
January 18, 2023

Yes. they all have the same code before the body. 

Participating Frequently
January 18, 2023
Nancy OShea
Community Expert
January 18, 2023

You're likely seeing a cached version of the former page. 

Clear your browser's cached data & history.  On most browsers, Ctrl + F5 or Ctrl + R.

 

If you're seeing this in Dreamweaver, close the app and restart it.

 

Nancy O'Shea— Product User & Community Expert
Participating Frequently
January 18, 2023

That is what I thought too. So I have cleared all my browsers cached data & history several times.   I have closed out dreamweaver and reboot the pc a couple of times. Still same result.

Nancy OShea
Community Expert
January 18, 2023

Open index.html and contact.html

Copy and paste top portion of code above the  <body> tag.   I want to see if they are both referencing the same Template.dwt and styles.

 

Also, .body_pattern is merely a class name.  It carries less importance than the parent selector <body>  or an #ID.  So there may be conflicting styles elsewhere in your site.

 

Nancy O'Shea— Product User & Community Expert