Search code examples
javascripthtmlcsswordpressstylesheet

css is linked to .html file


I recently downloaded a theme namely (scalia) it has lots of css but they are present in file with .html extension every page of this theme open good at local computer [not localhost (i am directly opening index.html in browser)] but when upload it to hosting it shows a mime type error.

Stylesheets are linked in this format

<link rel='stylesheet' id='layerslider-group-css' href="indexf67d.html?f=scalia/wp-content/plugins/LayerSlider/static/css/layersli‌​der.css,scalia/wp-content/plugins/contact-form-7/includes/css/styles.css,scalia/w‌​p-content/plugins/scalia-style-changer/css/ssc-style.css,scalia/wp-content/plugin‌​s/mailchimp-for-wp/assets/css/checkbox.min.css,scalia/wp-content/themes/scalia/cs‌​s/woocommerce.css,scalia/wp-content/themes/scalia/css/woocommerce1.css" type='text/css' media='all'/>

I already got these css file layerslider.css, styles.css, ssc-styles.css etc. etc.

My main question is [is there any alternative of the above code? so that i can replace this code and link my css files manually]


Solution

  • Yes.

    If you have a .css file in the same directory than your html file, you can include it that way:

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

    If it's in another directory, use relative path or complete path like so

    Relative: file inside folders that are in the same directory than the html file

    <link rel="stylesheet" type="text/css" href="folder/anotherfolder/myfile.css">
    

    Relative: file that is in the root of the directory containing the html file.

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

    Complete

    <link rel="stylesheet" type="text/css" href="C:/Users/yourname/Documents/CSS/myfile.css">