0

I have a folder called "HTML-CSS Files" containing a xhtml file called external.html. The folder also contains a folder called "css" which houses all my css files. The css folder has sub directories folders called "print" and "screen" grouping each css file based on their media type usage. The screen folder contains external.css and the print folder contains default.css and layout.css.

I'm using external.css to import default.css and layout.css but I don't know how to access them since they are not in the same directories.

@import url("..print/default.css");
@import url("..print/layout.css");

The code above is how I'm trying to import the other style sheets into external.css

M. Raza
  • 65
  • 1
  • 9

3 Answers3

10

Use ../ to go one directory up :

@import url("../print/default.css");
@import url("../print/layout.css");
Community
  • 1
  • 1
Reda
  • 711
  • 6
  • 17
3

I think you are missing a / after .. . Try ../folder/file

user3193257
  • 326
  • 3
  • 11
0

Just use URLs that are relative to your root web directory. It makes everything easy and clear:

@import url("/css/print/default.css");
@import url("/css/print/layout.css");
John Conde
  • 217,595
  • 99
  • 455
  • 496