Editor / hosting ref difference -...

User 2758718 Photo


Registered User
3 posts

Hello,

Total white-belt here, so please bear with me. I'm using HTML editor 15.1. While working in the editor I'm referencing my stylesheet and images and previewing them without issue.
<link rel="stylesheet" type="text/css" href="css/main.css">


I've uploaded the files to and folders to the public_html folder on my host numerous times and ways using cPanel, or FTP from the HTML editor, but it can't find the images or stylesheet unless there is a forward-slash in front of the folder name.
<link rel="stylesheet" type="text/css" href="/css/main.css">


Any ideas why is this happening and how can I get the two in sync? I've attached a screenshot of the file tress if thats nay help.

Attachments:
User 2287960 Photo


Ambassador
526 posts

Link to your site would be better.

Keith
User 2287960 Photo


Ambassador
526 posts

Relative urls, this might explain it:

https://css-tricks.com/quick-reminder-about-file-paths/

Starting with "/" returns to the root directory and starts there.

Keith

User 2758718 Photo


Registered User
3 posts

Thanks for the reply.

Site is here http://www.ondar.za.com
User 2287960 Photo


Ambassador
526 posts

CSS in capitals in editor change to lower case - see if that helps.

Keith
User 2758718 Photo


Registered User
3 posts

Read the link. Very helpful. Situation resolved.
User 2287960 Photo


Ambassador
526 posts

:)

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.