Re: An HTML/CSS question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 18-6-2014 6:41, Ethan Rosenberg, PhD wrote:
Dear List -

I really do not know where to send this, but feel that PHP programmers
are well familiar with HTML/CSS.

See the attached program.  The background file exists,

root@meow:/var/www/Webpages2# cd ..
root@meow:/var/www# ls Webpages2/Images/background3.jpeg
Webpages2/Images/background3.jpeg

but it does not display.

The script is in /var/www
The image is in /var/www/Webpages2/Images/

What is my mistake?

TIA

Ethan

Ethan, paths which you supply in CSS are paths to files called from the client. This means that they have to be relative to the current URI, not the system path. So this is fully dependent on how the server-path is translated to a domain-URI.

I would guess that "/var/www/Webpages2" is translated to something like www.example.com/, with "/var/www/Webpages2" thus being the domain root. If you then supply "url("Webpages2/Images/background3.jpeg")" it will look for www.example.com/Webpages2/Images/background3.jpeg in /var/www/Webpages2/Webpages2/Images which is obviously wrong.

Change it to /Images/background3.jpeg and it will most likely work.

- Tul

P.S. Why did you bother to echo all that HTML in the document? Just make it a fully static HTML file, no need for it to be partially PHP which simply prints static content.

---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux