How to add correct file path in html - html

All I want to do is add a relative file path for a .css file, into a html form. I've tried every permutation I can think of and it's still not finding it. I'm obviously doing something wrong.
I've added a screenshot, to show where both the html and css files are in the structure, and the file path I'm using in the html.
Can someone please help?

Remove "../" or "./" in all paths of src or href attributes then try to use the
<base href="http://example.com">
in your <head>

Sorry my previous answer didn't work. But I did realize what was going wrong. You had REL=STYLESHEET but it should be REL="STYLESHEET"

Related

How CSS file upload to index.html file in Github?

I uploaded index.html and CSS file in githuib pages.
like the images I uploaded.
But I don't know for what reason the CSS didn't load into index.html.
I guess it is because of the problem of the link addresse, but I don't how to fix it.
To make the CSS file to index.html file, how do i fix my codes?
enter image description here
you probably do have some problem with the linking of the css file.
normally css file should be linked between the head tag like this:
<head>
<link rel="stylesheet "href="filename.css">
</head>
to extend on this, if you have deployed your website on github pages, to see the effects there you need to push your changes to github first.
i want to add to Liemannen loop answer,
sometimes we need to add "./" on the css link like this if for some reason the css is not loaded
< link rel="stylesheet" href="./stylesheet.css">

How would I go about connecting a css folder to an HTML file?

Alright so this is my first post, and I'm sorry to bother with such a stupid question but I was wondering how would I go about writing a file path to a folder with my css in to and connect it to my HTML folder.
Would it be like ./FOLDER-Name/Style.css
because I have tried that but it hasn't worked. Someone please help, Thank You.
It will be like this
<link href="FOLDER-Name/style.css" rel="stylesheet">
example taken from the docs :
<link href="/media/examples/link-element-example.css" rel="stylesheet">
You just have to replace the href string to whatever path leads to your css file. I recommend using a relative path.

can you link a css file through html?

I just need some clarification about linking a css file. I am looking at a html widget that has been created by someone and they seem to have a html with a query string to get the required css..
<link href="https://cdnres.willyweather.com.au/widget/cssView.1-12-8.html?id=36723" rel="stylesheet">
And this works if you click on this link
http://cdnres.willyweather.com.au/widget/loadView.html?id=36723
But when i downloaded these files onto my own web server and tried it, it didn't work
http://www.mccdepot.com.au/Test1/loadView.html
but when I update the link styles to a css and updated the file name it worked.
http://www.mccdepot.com.au/Test2/loadView.html
For the query string html do I need to enable something on the server side?
Thanks in advance
i copied that link css add it to your code its coming same as given link i have added the screen shot check it.
try this->
<link rel="stylesheet" type="text/css" href="path of the css file"/>
This is how normally we include a css file in our html page. If still getting error, please check the file path properly.
your linked css file is minified, check it once. When you minify some
css files actually it replaces some variables. Try again to download
again and link it. And js files also not included properly, when it
check it in viewsource file was not found there

FontAwesome url paths

I'm using font-awesome and the path that gets generated from gulp is the following:
/src/stylesheets/css/fonts/font-awesome/
and then the rest of url follows normally. This is indeed the path to the fonts but they do not appear. If I just manually change the path in the css to:
fonts/font-awesome/
then things are fine. I don't have any issue at all with bootstrap with the generated path as first noted. The css generated file gets placed under the "css" folder so then naturally going to "fonts/font-awesome" is not an issue but it's that full path it doesn't like.
Ideas?
Thanks
Why don't you try absolute link
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
Hope it helps

How to link a HTML page to a CSS file when the CSS file is in an upper directory?

There is my problem:
Since I had some organization issues with my website, I wanted to arrange my files to a better classification.
Now, the folder tree looks like:
www
ressources
images
...
css
design.css
mypage1
index.html
mypage2
index.html
index.html
And now I don't know how to link the css file to the pages stored in a folder like the "mypage1" folder.
To start from my C: drive will will produce path errors once online, I tried the "shortcuts to the css file in each folder" solution too, but I think there is a far better way to proceed.
Need some help!
Thanks again!
use the link:
<link type="text/css" rel="stylesheet" href="../ressources/css/design.css">
here, used ../ going back folder..
You can use:
<link rel="stylesheet" href="../ressources/css/design.css" type="text/css" media="all">
The .. will go one directory top. Since the html files are in a directory (like mypage1), this will go to the parent directory, which is www. Then the next that should be done is to pass the directory path to your CSS file, which in your case is /ressources/css/design.css.