Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

One way to make images function correctly without requiring the complete file root is to use relative paths instead of absolute paths. This means that instead of specifying the full URL or file path for an image, you would only specify the portion of the path that is relative to the current directory or document.

For example, if your webpage is located at "http://example.com" and your images are stored in a folder called "images" that is located in the same directory as your webpage, you could use a relative path like this:

This tells the browser to look for the image file "example.jpg" in the "images" folder that is located in the same directory as the current webpage.

By using relative paths, you can make your images function correctly no matter where your website or files are located, as long as the folder structure and file names remain the same.