-1

My index.html file is in the public_html directory. All css files/ image files are in a css directory, and images directory respectively.

I have been over and over my code but the index is not linking with anything in hosting. `

<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/flexslider.css">
<link rel="stylesheet" href="css/jquery.fancybox.css">
<link rel="stylesheet" href="main.css">   // ***
<link rel="stylesheet" href="css/responsive.css">
<link rel="stylesheet" href="css/animate.min.css">
<link rel="stylesheet" href="css/font-icon.css">`

*** I moved the main.css file directly into public_html to see if it would work and it does. I can only assume that I have made a mistake in my path.

BTW I have added a / to the css path in href. I don't want to move everything into the public_html folder, which I am taking to be the root

Many thanks

kevinl
  • 4,194
  • 6
  • 37
  • 55
murpjack
  • 15
  • 5
  • The main.css file will now link to index.html – murpjack Oct 26 '17 at 18:00
  • As long as the rest of the CSS files are in the structure `public_html/css/*****.css` then it should work. Are you getting any console errors? – APAD1 Oct 26 '17 at 18:03
  • 1
    Add at least 1) used webserver 2) operating system 3) error code returned by the webserver on these files 4) any relevant entries in the server's logfiles . Also, are css and images subdirctories of the public_html dir (which seems to function properly as main.html is served correctly) – fvu Oct 26 '17 at 18:03
  • @murphyMe Please add your complete directory structure to your question so we see the necessary relative paths. – Progman Oct 26 '17 at 18:47

1 Answers1

0

This might be redundant but one possible workaround is to use ./ everywhere. Eg.

<link rel="stylesheet" href="./css/bootstrap.min.css">
<link rel="stylesheet" href="./css/flexslider.css">
<link rel="stylesheet" href="./css/jquery.fancybox.css">
<link rel="stylesheet" href="./main.css">   // ***
<link rel="stylesheet" href="./css/responsive.css">
<link rel="stylesheet" href="./css/animate.min.css">
<link rel="stylesheet" href="./css/font-icon.css">

It should work.

Assuming the css folder and main.css are the siblings of the HTML file in which this code is inserted .

Abhilash Nayak
  • 664
  • 4
  • 10