Hello.

Currently I am using XP and I wanted to save a CSS-file, yet I cannot save it correctly which results in the fact that I cannot properly link to it, meaning that every style I try, will not be accomplished. Can anyone help me? I'm grateful for any reply.. :)

Dani AI

Generated

A few focused checks save a lot of time on XP. was correct to point out the importance of the file extension, and ’s path remark is useful — the usual missing piece on XP is the system hiding the real filename or Notepad appending “.txt”, so the file is not actually a CSS file even though it looks like one.

Make extensions visible (Windows Explorer → Tools → Folder Options → View → uncheck "Hide extensions for known file types") and confirm the file really ends with .css. When using Notepad, use Save As with the filename including the .css extension (or use an editor that lets one choose encoding and exact filename). Right‑click → Properties will show the true file type. If the file displays HTML or odd characters when opened directly in a browser, the saved encoding or file contents are wrong.

Check encoding and delivery: Notepad’s UTF‑8 option on older Windows can add a BOM; try saving as ANSI or UTF‑8 without BOM via a code editor (Notepad++ or similar) if strange characters appear. Clear browser cache (hard refresh, e.g. Ctrl+F5) and use the browser’s developer/network tools to confirm the stylesheet is being requested and returned with Content-Type text/css. If served from a web server, confirm file permissions and MIME mapping.

Given ’s final note that a system setting change fixed the problem, the steps above (extensions visible + correct save method + encoding check + path verification) will resolve the vast majority of CSS “won’t load” cases on Windows XP.

Recommended Answers

All 4 Replies

CSS files use the file extension .css and you may use a notepad to create/edit this file.

Try typing this on a notepad:

body { background-color: red; }

..and save it as mystyle.css

Then on your html file, use the code below to reference/link to your css file:

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

Of course, both of your html and css must be in the same folder.

Hope this helps. :)

Thanks for your fast reply. I did though. Yet it doesn't work, dunno what's wrong. The file as you look at it doesn't give any notification about what kind of file it is, not even the html-file, though that one just works fine. But I can never tell, if it is html. However the point is that I cannot link to my CSS.. :/

so post your code so we can look at it.
you might need to also do the following:
change this <link rel="stylesheet" type="text/css" href="mystyle.css" />
to this <link rel="stylesheet" type="text/css" href="../mystyle.css" />

Well, I was able to figure out what was wrong, it was something as to the system, I just had to adjust things, it was not my computer though. Anyways I made it, I could style everything. :) Thank you guys though. :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.