Can´t understand what´s wrong :(

<PLEASE USE THIS TEMPLATE TO HELP YOU CREATE A GREAT POST!>

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

<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>

```

Replace this line with your code.

Dasmoto´s arts and crafts

Dasmoto's arts & crafts

Brushes

Hacksaw Brushes

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. Starting at $3.00 / brush.

Frames

Art Frames (assorted)

Assorted frames made of different material, including MDF, birchwood, and PDE. Select frames can be sanded and painted according to your needs. Starting at $2.00 / frame.

Paints

Clean Finnish Paint

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. Starting at $5.00 / tube.

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

<do not remove the three backticks above>

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.

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

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.

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.

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.

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