HTML and CSS HELP?
Help!!! Can someone who knows HTML explain to me why my website (when I save it in a zipped folder) no longer displays the way I want it to. All the images are gone, and the CSS design isn't being applied… I urgently need help!! :…(
Image 1: actual website
Image 2: zipped, same website
If you compress folders as a zip archive to forward it to third parties, it must be completely unpacked at the end and viewed with a web browser. Otherwise, the path details run into the blank because the files do not exist.
When creating the zip archive or even when creating the websites, care should be taken that linked files with relative paths are specified and the necessary files (CSS, JS, graphics etc.) are located in the project directory.
If an HTML document is in a zip archive and tries to open only this, only this document (temporarily) is unpacked, but not the associated files. Consequently, no CSS can be loaded when calling.
This means even if I now compress it into a zip file and it looks like picture 2 that people still need to unpack it to see picture 1 completely?
Exactly, the person must unpack the entire archive.
You can imagine the Zip archive as a product package. In this is the device, the accessory and the user manual. To be able to stretch and use everything, it must be removed from the packaging.
In your case, it’s not a device, it’s HTML. And the accessories would be your CSS as well as pictures and graphics. The person unpacks everything and can then open your HTML in the browser in which your CSS is loaded.
If it is still displayed incorrectly, you might have to work with absolute paths instead of relative paths and therefore not load files.
With relative paths you move within the project folder and it doesn’t matter if the page is now from your computer or from where it is opened elsewhere. Just because everything is in this directory.
ah ok understand, now it's some clear THANK YOU :). But what if the other person still sees as picture 2 even though she has unpacked everything?
Hi,
if you access a single HTML file from a ZIP file, the remaining documents such as CSS, images cannot be loaded. That’s what the whole folder needs to unpack.
However, the CSS file does not look like this.
Probably you need to change the address of the CSS program in the heading part of the body (at the beginning of the body), as this file is stored elsewhere during compression.
Edit: The memory path of the CSS file changes.
Okay, how do I do that exactly when I can ask?
You’ll have written the program code somewhere.
Copy the memory path of the CSS file in the ZIP-compressed function and insert it in the heading of the body at the place where style is in the <> characters.
To uncompress, then compress again.
I have this function:
Because then the folder paths no longer fit and your browser or server (Apache, Nginx etc.) can no longer access the files.
If you unpack the Zip file again, everything should work again.
have this Zip file jemaandem sent to see if it is the same for other people. It was with others as with me now
yes, it looks right, that is a relative path. However, it can only work if the Zip file has been unpacked, then the CSS file must be in the same folder as the index.html file (also not in subfolders or the like)
so:
or they must be: href= “CSS-Document_Index_.css”
You can’t store websites in zip folders.
When you do this and open the HTML file with a double click in the Windows Explorer, only the HTML file is temporarily unpacked, but not the images and css files.
The solution is simple: not dolls.