htmlweb-hostingpublic-html

nothing is linking with html in hosting


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


Solution

  • 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 .