I've been using w3schools for a long time and i've never had a problem linking css to my html until today. I have a whole bunch of files referenced as such:
<link rel="stylesheet" href="http://enviroptics.com/Matt/css/styles.css"/>
And I checked the url and when i go to the page everything looks correct in the css, but for some reason it isnt pulling the styles into the html the way it has been for the last 6 months for me... I tried using the chrome editor to see what the problem and it says that my file is not https. It never has been https and i have been using it for many months with no problem.
Does anyone know why it would stop working all of a sudden? Is there another editor that i might be able to use? jsfiddle also tells me i need https..
Any help would be greatly appreciated!
Thanks
open http://enviroptics.com/Matt/css/styles.css.
copy all.
open blocknotes or simple text editor
paste all
save file( name = styles.css )
insert this file in Matt/css in your web server ( ftp )
add <link rel="stylesheet" href="/Matt/css/styles.css"/> in your code html -> head
Related
I'm working on an assignment for class and I cannot get my CSS to attach at all to the html. I'll upload files as well as give the text-format of what exactly is going on but I've tried a few different things. I am a beginner but I have checked and double checked file paths. When I ctrl+click on the link within svc I consistently open the file. Chrome dev tools shows it as unable to find though.
This is my current set up in html5 :
what I see on vsc
my files are located in the same folder - the wireframe_stylesheet.css is definitely spelled correctly in both places. I've tried doing a / in front of wireframe. I've tried moving the file around and then adding / and folders. I've tried doing a long rout (not sure if it's the name) but all the way from C:// down to the file itself, and nothing seems to want to link it. I've also tried adding style="text/css" that didn't work either. I've tried adding the (.) before and after the file name, I've tried adding the folder above it so that it will go back into the file, I've tried adding a / after the " - still nope.
My html
My Css (sort of, there's more but this is the gist)
Try this
<link rel="stylesheet" href="./wireframe_stylesheet.css">
But I believe you've done something wrong in HTML code, share the full code so I can figure out what's wrong in it.
Use this snippet in between the head tag
<link rel="stylesheet" href=".Your CDs file name.css">
I am hosting the website on a home server so we aren't going through a third party. Even though I have the CSS linked, the file in the same area as the HTML, and the images all set up just one file away, nothing is showing up aside form basic HTML.
Please let me know if you've run into this problem of the HTML file working UNTIL it's hosted on our server and how you've fixed it. Thank you!
When I load just the HTML file in my browser (chrome) everything shows up beautifully, but once I try to host it, nothing looks the same.
Here is some of the code I used to link the CSS file and the images just to make sure there's nothing wrong there:
<head>
<title>Alexandra ReganHolzheimer</title>
<link href="pages_style.css" rel="stylesheet" type="text/css"
media="screen">
</head>
And for the images:
<div class="container">
<img src="img/me3.jpg" alt="me" class="logo">
</div>
UPDATE: I think I figured it out. The issue turned out to be that my server didn't like underscores and a lot was case sensitive. Your suggestions were super helpful and put me on the right path.
thank you!
Once u load your URL on browser. Then see the page source. In pagesource please check your css is loading correct or not. If error means please correct it and then load again.
I faced a similar issue when I tried hosting one of my learning projects onto a server.
I fixed it by making all the references relative.
For example:
If your file structure is like:
your_project /
pages_style.css
index.html
img/
Just change your paths, from: img/me3.jpg to ./img/me3.jpg in your index.html.
I hope it helps. :)
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'm new to ASP, ASP not ASP.NET. I've programmed before, had experience in PHP. I have many experience with HTML and CSS. I like to organise my files. I know (in php file) I only have to link the external css in the tags to style my webpages. I assume it's the same for ASP. It does, but not for me.
Whenever I tried to edit the style of my asp program and run it in the server it doesn't work. I created other pages as well and same thing happened. Whenever I used Google Chrome to see the elements, I could see my code, but when I click on the style sheet in the 'INSPECT ELEMENT' tool, it opens at the side with nothing there. I did script the css, and tried to make the background color black. The styling works only when I do an internal styling within the asp file between the tags.
Does anyone know how I may solve this issue? I hate using internal css as external ones are faster and more organised.
Check the following common issues:
Make sure your stylesheet file has a file extension of .css
Check if you have a MimeType setup for .css files as text/css in your IIS.
If you're returning CSS code from a .asp page file extension, make sure you first call Response.ContentType = "text/css" at the top of the page.
When including it in your html document make sure you're using something along the lines of the following syntax:
.
<link rel="stylesheet" type="text/css" href="mystylesheet.css">
I have created a very small personal website with three different pages and one CSS file. I know to embed a CSS file into an html page is the following:
<link rel="stylesheet" type="text/css" href="mystyle.css"/>
but form some reason the CSS file only work in one page. Any advice please
Did you checked your folders structure? You may have other html file in different folders.
I suggest to use an absolute path for your stylesheet. something like:
<link rel="stylesheet" type="text/css" href="/css/mystyle.css"/>
first / in href parameter is what I mean.
Edit: You may use a windows machine and upload your files into a Linux machine. Windows do not care about lowercase or uppercase, but it is important on Linux. rename all your filenames to lowercase every where and use it exactly the same in your code (check your link tags again). this may fix your problem
Sharing the link of the site would be helpful. Make sure that the line of CSS aboves goes on each page. For example, if you have 3 pages with 3 different files: index.htm, bio.htm and contact.htm (I'm having to guess since I have not gotten this info from you). Then make sure the link to the CSS above appears on each of those pages.