This might look a bit stupid, but I cannot seem to connect my HTML to my external CSS stylesheet.
It doesn't change the color of my text. I have tried different CSS commands but nothing seems to work. Help would be greatly appreciated haha...
Your css file names is style.css not "styles.css" the mistake is in your href link
You wrote the wrong file name on your href by mistake. Just change it to style.css like this :
<link rel="stylesheet" href="style.css">
Related
Im trying to style a page but in the chrome dev tools there is an scss file that i dont have anywhere local.
When I hover the style below, I get this link :
https://cdn.jsdelivr.net/npm/bootstrap#5.2.0-beta1/scss/_reboot.scss
Im trying to get it to connect to the css file but the normal
<link href="css/style.css" rel="stylesheet">
doesn't work.
Thank for your help
Let me try to help you.
From the docs that i read, to link the external resource element to our html was similar with your code.
<link href="/media/examples/link-element-example.css" rel="stylesheet">
But, i think we have to make sure that your href was correct to the css file that you need.
It was really important. Because if we didn't input the correct relative path, the css file will never be can use in the project.
Thank you
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.
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"
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
I downloaded some css template from the web, copied the folders containing the css files and pasted them in my project, i used their html code as well in order to test the page on the server. It just doesnt work and i went through all the steps on the internet to link css to html.
The css folder is inside WEB-INF, the jsp pages are inside web content, i can't yet post an image on the site so i'll hope you can picture the structure.
<link rel="stylesheet" href="/WEB-INF/css/animate.css" type = "text/css"/>
this is the link syntax i'm using copied from stackoverflow.com and even if i include the project name in the path, it still doesn't work.
Is the folder structures wrong ? or something with the link syntax ?
any help appreciated
change
href="/WEB-INF/css/animate.css"
to
href="/css/animate.css"
You don't need to write that... css, pages and images are usually put into the webcontent folder (as per practice).
I Think you have just to be simple and link your css like this:
This work in HTML, PHP
<link rel="stylesheet" type="text/css" href="css/animate.css" />
This is for ASP.NET
<link rel="stylesheet" type="text/css" runat="server" href="css/animate.css" />
I Hope it help!