Can´t understand what´s wrong :(


#1

<Below this line, add a link to the EXACT exercise that you are stuck at.
Hi everyone, I´m trying to connect the css and html files in the final exercise of the unit 2, Dasmoto´s arts and crafts. But there is no way. I´m working in atom. The css file route is :"/Users/anabelen/Documents/projects/Dasmoto´s arts and crafts/resources/css1/style.css". The index.html is in the Dasmoto´s arts and crafts folder. I have tried using the relative path, and the full path explained above, but there is no way it works.


Replace this line with your code. 
<!DOCTYPE html/>
  <html>
    <head>
      <title>Dasmoto´s arts and crafts</title>
      <link href= "/Users/anabelen/Documents/projects/Dasmoto´s arts and crafts/resources/css1/style.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
      <div id="h1">
        <h1>Dasmoto's arts & crafts</h1>
      </div>
      <div id="Brushes">
        <img src="https://s3.amazonaws.com/codecademy-content/courses/freelance-1/unit-2/hacksaw.jpeg"/>
        <h2>Brushes</h2>
        <h3>Hacksaw Brushes</h3>
        <p>Made of the highest quality oak, Hacksaw brushes are known for their weight and ability to hold paint in large amounts.
          Available in different sizes. <span>Starting at $3.00 / brush.</span></p>
      </div>
      <div id="Frames">
        <img src="https://s3.amazonaws.com/codecademy-content/courses/freelance-1/unit-2/frames.jpeg"/>
        <h2>Frames</h2>
        <h3>Art Frames (assorted)</h3>
        <p>Assorted frames made of different material, including MDF, birchwood, and PDE. Select frames can be sanded and painted according to your needs.
          <span>Starting at $2.00 / frame.</span></p>
      </div>
      <div id="Paint">
        <img src="https://s3.amazonaws.com/codecademy-content/courses/freelance-1/unit-2/finnish.jpeg"/>
        <h2>Paints</h2>
        <h3>Clean Finnish Paint</h3>
        <p>Imported paint from Finland. Over 256 colors available in-store, varying in quantity (1 oz. to 8 oz.). Clean Finnish paint microbinds to canvas,
          increasing the finish and longevity of any artwork. <span>Starting at $5.00 / tube.</span></p>
      </div>
    </body>
  </html>

Which would be the right relative path? What am I doing wrong?


#2

This is the simplest relative path to your css:

href="resources/css1/style.css"

Aside:

Please post a link to the page with the above mentioned lesson text.


#3

Hi, that was my first try, but it didn't work.... I can´t figure out why. I have tried using just one line in css:

h1 { color: red;}.... but it stays black. I also tried "/resources/css1/style.css", ./, but no way


#4

Remove the leading / and write the URL like in my earlier example. That way it looks in the same folder as index.html for the resources folder.


#5

It works!!!! Why??? I swear it was my first try.... Anyway, thanks a lot, I was going crazy .... So, if they´re not in the same directory, the first folder which is not the same for both of them must be named without "/", did I get it right?

Let me ask you something else, please. I have been placing them in a different folder since that was what we were asked for in the lesson, but is there any problem if I use the folder "hello" and include both the index.html and style.css files in it? Thanks again.


#6

Wherever the index.html file can be seen as the site root. All resource files should rightly be in folders on the same root. Then they can be accessed with relative URLs.

+ projects_folder  (root)
    - index.html
    + css
        - styles.css
    + images
        - picture.jpg
    + js
        - script.js

Above is typical basic organization of resources. We generally want only HTML files on the root. Others will be one of the resource folders as above.


#7

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.