1

I have 3 pages:

  • index.html

  • pages/top-ten.html

  • pages/contact.html

My CSS code is in

  • css/css.css

Everything is fine with the index.html but when I copy the code to the other 2 pages the CSS isn't responding to that.

I'll attach snippets of the code index.html

2
  • did you add the link to the stylesheet on each page? Commented Jan 12, 2022 at 19:23
  • Next time please show us the necessary code information directly as code (not as image). It is much easier to copy & paste. Commented Jan 12, 2022 at 20:16

1 Answer 1

2

Change

<link rel="stylesheet" href="./css/css.css">

to

<link rel="stylesheet" href="../css/css.css">

This will find the css file from those files which are one level deeper in the pages folder.

Sign up to request clarification or add additional context in comments.

2 Comments

thank you! So if its ever in a folder it will need an extra"." ?
Exactly, the ../ means one level up, while ./ means in the same folder

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.