Sublime Forum

No links working in Sublime Text 2

#1

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">

Michael R Shull

  • Who am I
  • How to Contact me
  • Core Values
Snow Tiger IMDB

styles.css

body{
background-color: yellow;
}

0 Likes

#2

okay its not showing the code for HTML

here are the other two links

<img src=“desktop/MichaelRShull/pics/snowtiger.jpg” alt=“Snow Tiger” title"Beautiful Snow Tiger">

<a href="www.IMDB.com"> IMDB </a>
0 Likes

#3

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.

0 Likes

#4

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:

```
<html>
    <head>
        <title>Page Title</title>
    </head>
    <body>
    </body>
</html>
```
2 Likes

#5
<Doctype html>
<html lang="en">
 <header>
 	
 	<title>Michael R Shull</title>
 	 <link href="style.css" rel="stylesheet" type="text/css">
 </header>
 <body>
 	<h1>Michael R Shull</h1>
 	<ul>
      <li>Who am I</li>
      <li>How to Contact me</li>
      <li>Core Values</li>
 	</ul>
 	<img src="MichaelRShull/pics/snowtiger.jpg" alt="Snow Tiger" title"Beautiful Snow Tiger">
 	<a href="www.IMDB.com"> IMDB </a>


 </body>

Thank You! Hopefully this works

0 Likes

#6

Didnt work

0 Likes

#7

I copied the back ticks from your response, but it did not work.

\

<title>Michael R Shull</title>
 <link href="style.css" rel="stylesheet" type="text/css">

Michael R Shull

  • Who am I
  • How to Contact me
  • Core Values
Snow Tiger IMDB
0 Likes

#9
img src="MichaelRShull/pics/snowtiger.jpg" alt="Snow Tiger" title"Beautiful Snow Tiger"
a href="www.IMDB.com"> IMDB /a

 link href="style.css" rel="stylesheet" type="text/css"

I took the <> but these are the lins as typed.

0 Likes

#10

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.

0 Likes

#11
`indent preformatted text by 4 spaces`
    <Doctype html>
<html lang="en">
 <header>
 	
 	<title>Michael R Shull</title>
 	 <link href="style.css" rel="stylesheet" type="text/css">
 </header>
 <body>
 	<h1>Michael R Shull</h1>
 	<ul>
      <li>Who am I</li>
      <li>How to Contact me</li>
      <li>Core Values</li>
 	</ul>
 	<img src="MichaelRShull/pics/snowtiger.jpg" alt="Snow Tiger" title"Beautiful Snow Tiger">
 	<a href="www.IMDB.com"> IMDB </a>


 </body>
0 Likes

#12

I forgot to mention that I am using Chrome to check my work. When I go into the developper tools, it is showing a CHrome

0 Likes

#13

Based on the HTML that you have posted above, your file layout needs to look like this:

.
|-- MichaelRShull
|   `-- pics
|       `-- snowtiger.jpg
|-- index.html
`-- style.css

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.

0 Likes

#14

Thank you for replying, I have the folders correctly as you stated

I also fixed the .css file, from styles.css to style.css.

css still not working hmmmmmm…

The picture works, i found a type O in the code.

0 Likes

#15

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.

1 Like