Editor not using my CSS files -...

User 772771 Photo


Registered User
15 posts

Hi there

I have a simple HTML page using a single CSS file. The file link looks like this
<link rel="stylesheet" href="/css/main.css" type="text/css"/>
Works fine when published

When using the F11 preview in HTML Editor, the preview window cannot find the css file unless I give it an absolute path:
<link rel="stylesheet" href="c:/myvbcode/v7winv2/package/web/css/main.css" type="text/css"/>

Is there a setting in the Editor which will allow me to tell the F11 Preview where my CSS file is please

Thanks
User 1948478 Photo


Senior Advisor
1,850 posts

Try removing the leading "/" in the href:
<link rel="stylesheet" href="css/main.css" type="text/css"/>

Other than that, if your local file path is correct, the css file should be found.
For example, your index.html file would need to be here:
c:/myvbcode/v7winv2/package/web/index.html
User 772771 Photo


Registered User
15 posts

Nope, no luck, still cannot find the css file unless I give a complete path from the root
User 603315 Photo


Registered User
938 posts

Nigel Thomas wrote:
Nope, no luck, still cannot find the css file unless I give a complete path from the root

You might have done this but load your css file in the editor do save as and put your css file togethr with index.html. Sometimes you can get issues that are illogical but if you havent done that see what happens
User 772771 Photo


Registered User
15 posts

G'kar Am I understanding this correctly? I need to copy and paste my css file's contents into my html file for it to work?
User 38401 Photo


Senior Advisor
10,951 posts

This sounds like you don't have your css files inside a css directory on the root directory of your site. In other words, wherever the index.html file is there should be a css folder with your css files in it right there. If you don't have that then it won't be able to find them.

Also, just to be sure, what version of the HTML Editor are you using?
User 603315 Photo


Registered User
938 posts

Nigel Thomas wrote:
G'kar Am I understanding this correctly? I need to copy and paste my css file's contents into my html file for it to work?

Sorry to take a while to reply. Just the same Jo Ann said shiuld be in same folder
User 772771 Photo


Registered User
15 posts

Jo Ann

Everything reside in web which contains
web
image
html
css

all files are in the appropriate directories

Editor is latest version 14.723
User 772771 Photo


Registered User
15 posts

anyone? This really has stopped me using Coffee Cup, surely this is a fundamental issue which need resolving
User 603315 Photo


Registered User
938 posts

Nigel Thomas wrote:
anyone? This really has stopped me using Coffee Cup, surely this is a fundamental issue which need resolving


Just give me a sec and I'll show you a screenshot of how things are supposed to look

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.