I am facing a problem with CSS, I am linking it and changing the body color, and nothing has changed, and when I open a view page source, the modification appears on the CSS page already?
Make sure that you type <link rel="stylesheet" type="text/css" href="theme.css"> in the <head> of your html document, the code you tope is correct, both documents are in the same file and that you save your CSS file before you check your result.
If you want a better answer, post your code.
Related
I'm confused. I've been trying to link my home-page to my stylesheet, but no matter how many times I reload the page, it won't load the link. I'm following the book that I have, and I'm copying the link, but on the page it doesn't show up. Can someone tell me what I may be doing wrong or what I should be doing?
The general way to import a stylesheet to your HTML code would be like that:
<head>
<link rel="stylesheet" href="styles.css">
</head>
Depending on how your stylesheet file is named you need to change the "styles.css" part to your filename. Consider checking the filepath again, which is important for many frameworks.
I'm new to coding and understanding the cPanel File Manager.
I have uploaded my HTML webpages into folders and haven't been able to figure out how to make all of them use one CSS file. I've managed to make my pages all look as I want by uploading the CSS file into each webpage folder, but when I want to change one thing about the CSS, it gets really tiring to go through each individual one.
I'd imagine there's an easier way to do this, but I can't figure it out.
Assuming your hierarchy looks like this:
index.html
other.html
more.html
styles.css
just put <link rel="stylesheet" type="text/css" href="styles.css"> in the <head> of each page.
If instead, your hierarchy looks like this:
index.html
other.html
more.html
styles
-styles.css
you can instead use <link rel="stylesheet" type="text/css" href="styles/styles.css"> and so on
Why isn't my HTML linking my CSS properly? using the Prologue template from html5up.com... In my main directory (I mean where index.html is) I created a subfolder for the different products I want to display. This folder contains a few files: 125st.html, 125stmain.css, and a folder called _notes created by Dreamweaver. Here is the code in the 125st.html that should be linking to the 125stmain.css:
<link rel="stylesheet" href="products/125st/125stmain.css" />
When I visit shercousa.com/products/125st/125st.html (It wont work for you, I've just tricked the hosts file to go to my local save instead of the live site while I work on it) it shows no CSS only the HTML. I just copied this line from the index.html file (which works) and changed the folder to try to direct it to the CSS clone I created. When this didn't work I tried copying and pasting the original line verbatim that works on the main site, but when linked in 125st.html still loads no CSS at all. I'm a bit new so sorry if I'm a bit hard to follow. I can elaborate or post any more code if anyone needs to see it.
Edit: Also my images are not loading, even the ones linked in the html file.
If i'm not wrong, this have an easy solution.
If you're on host/products/125st/125st.html and you linked CSS this way:
<link rel="stylesheet" href="products/125st/125stmain.css" />
What it's happening there is that your file 215st.html is trying to find: host/products/125st/125st.html/products7125st/125stmain.css
So you can either link your css with both this ways:
<link rel="stylesheet" href="/products/125st/125stmain.css" />
or
<link rel="stylesheet" href="125stmain.css" />
I hope this works for you :)
And sorry for my english!
Ga, I'm such a dope. There should be a slash in front of products like so:
<link rel="stylesheet" href="/products/125st/125stmain.css" />
İ have already searched for a similar topic and failed on finding it. The problem i'm having is about relating my HTML file with the CSS file. Before reading the code, please notice that the two sheets are on the same file and the names are properly written. It would be appreciated if you could help me notice why it doesn't work.
Also, if I've done anything wrong, please don't hate.
Here is the code:
<html>
<head>
<title>My First Website</title>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="Style.css">
</head>
Thank you in advance!
Firstly try opening up your html file in the browser. And then do inspect element. See if you can see your Style.css in the css list populated.
If you cannot access that that means either the path of your css is not correctly mentioned in the html or there is some issue with the spell if css file.
There is nothing wrong with your code, however you should ensure that the .CSS file is in the same directory or use dynamic references for the files. This is done by simply adding a .../CSS FILE/Styles.css for example :)
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!