0

I'm learning webdesign, HTML, and CSS all for the first time to build my own site from the ground up, so this may be a very amateur question, but I am genuinely curious. I'm using notepad++ to write everything and currently have all of my files saved locally to work on before uploading them to Neocities.

When I want to link to a file as a source, I simply copy+paste the file-path. When I do this, the file-path on Windows uses back-slashes "\". The CSS file seems to only accept URLs with a forward-slash "/". Why is this?

Its gotten pretty annoying to paste the file-path and then manually change every \ into a /. Is there any way to either automate the process of changing each \, or is there a setting I can change to make the file-path copy using /? Is this a weird notepad++ quirk?

Any advice is appreciated. I'm learning how to do all of this myself, and its been quite a journey.

1 Answer 1

1

The reason you're seeing this difference is that Windows uses backslashes () in file paths, while URLs and web paths (like in HTML and CSS) use forward slashes (/). When you're coding for the web, you always need to use forward slashes, regardless of what your Windows file path shows. To make things easier, instead of copying and pasting the file path directly from Windows, you can just type out the relative path using forward slashes. Alternatively, you could automate the process of replacing backslashes with forward slashes by using a text editor feature or a simple find-and-replace in Notepad++.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.