I am trying to link my css file, a picture and website to my HTML file but they are not working, the pic and css file are in the same folder. I have read books, watched videos over and over, so I know that I have the code typed in correctly, still no link is working. Here is my code HTML first, then CSS. I am beginning to think that there is a corrupted file in Sublime text. not sure though. Any help would be greatly appreciated. Thanks
<title>Michael R Shull</title>
<link href="style.css" rel="stylesheet" type="text/css">
since a number of people have seen this post and none seem to be able to help, or want to help, can someone at least point to where I can find the answer myself? Thought this community was better.
The Sublime Text community is global; not everyone may be in the same time zone as you.
Can you edit your above posts to add code fences (three backticks) before and after your HTML? That will allow us to see what your HTML looks like so we can assist better. In the post editor it would look like this, for example:
Another way to get the same effect is to select the entire part of your post that represents the HTML, and then while it’s selected press the </> button in the post editor toolbar to tell the forum that it’s pre-formatted text, so that it doesn’t try to interpret it as HTML.
That is, the index.html and style.css need to be in the same directory, and the image needs to be in a folder named pics that is inside a folder named MichaelRShull that is in the same directory as the index.html file.
In your first post you’re saying that the content of styles.css is:
body{
background-color: yellow;
}
There’s nothing wrong there, but note that your page says that the CSS file it’s trying to load is style.css, not styles.css. I assume that was just a typo in your post, but if not then you need to either rename the file or edit the page so that the two names match.
A last thing to consider is that if you’re using Linux, it’s sensitive to the case of file names, so e.g. index.html and index.HTML are not the same file as far as it’s concerned. Windows and MacOS don’t work that way, but most web servers run Linux so it’s something to keep in mind.
Not that there’s any evidence of your doing that here or anything; it’s just the only other thing that immediately jumps to mind for why things might not be working for you in this situation.
I figured it out with your help. I some extra code that was not supposed be there. Thank you for your help. I apologize for the snarky comment aI made about the community. I truly appreciate your help.