Jump to content

Recommended Posts

Posted

I am not sure what I am doing wrong. I am experienced with making web pages

so this is especially frustrating. I created a page in html, then re-wrote it in php.

My problem is that the background image does not appear when I open the web

page. It works fine when I test it on my desktop, but after uploading it, it doesn't

show when I load the page. The image is in the same folder as the page. Here

is a link to the page: http://www.areacode860.com/mary5/ I have tried

leaving the background in the <body> tag and also putting it in the style sheet

to no avail. Any help would be greatly appreciated.

Thanks,

Dave

Posted

Hi Dave.

Don't know of this helps, but I noticed you have 2 <head> sections and 2 <body> tags. Perhaps the second one is overriding the first?

Posted
Hi Dave.

Don't know of this helps, but I noticed you have 2 <head> sections and 2 <body> tags. Perhaps the second one is overriding the first?

 

 

I'm pretty good with html, new to php, so I'm not sure on this, but don't I need

those tags? There are one set of opening and closing <head></head> and

<body></body? tags. Does php not use them? From some of the stuff I've

read on the net, it seems I can technically just change the extension of a page

from .html to .php without a problem.

Dave

Posted

A web page is only supposed to have one set of <head>...,/head> and one set of <body>...</body> tags. Your page has 3 sets of <head>...</head> tags and 4 sets of <body>...</body> tags. Since these are HTML tags, php will not do anything with them other than output them to the browser.

 

Your background is not displaying because your stylesheet is not linked correctly:

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

With the slash in front of the stylesheet filename, the browser is looking for the stylesheet here:

>http://www.areacode860.com/stylesheet.css

...but your stylesheet is actually here:

>http://www.areacode860.com/mary5/stylesheet.css

When the browser can find your stylesheet, the CSS you have in your stylesheet already will display the background:

>body { background: url(bg_lilac.jpg);}

Posted

Thanks for all your help! I got it to work. Part of it was where the file was

located, but it still didn't work. It also turns out that all of the html files that

were being "included" in also each had a style tag in their <head> tags that

I was using as I tested it on my desktop. Once the <style> tags were removed

from each of the html files, it works great. Thanks once again!!!

Dave

Posted
It also turns out that all of the html files that were being "included" in also each had a style tag in their tags that I was using as I tested it on my desktop. Once the

Dave, your includes should not contain a

section either except the header. HTML should only have one set of tags in it.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...