CssHidex v1.16
Maintain relative path

When you reference a web resource such as an image in your CSS file, you can use a relative path like shown below.

.my-box {
   background:url("../image/pic.jpg");
}

A relative path to an image specifies the relationship of where the CSS file and where the image actually is.

When you place the CSS file in your website, you know you must not break the relative path. The same rule applies to the JavaScript file that you generate from the CSS file using CssHidex.

If you obfuscate a CSS file that contains a relative path, the output JavaScript code also contains the same relative path. Since the JavaScript code is already obfuscated, you may not realize it easily. That is why CssHidex alerts you with the following message.

Relative Path Found!

The purpose of the message is remind you of the fact that the JavaScript file contains at least one relative path so you must put it in your website in such a way that the relative paths are maintained.

What if you didn't place the output JavaScript file in a correct place? Then the image would not show up because the relative path is broken.

The easiest way to decide where to put the output JavaScript file is put it in the same folder as the input CSS file is located.

For example, if the path of the CSS file is mysite/css/style.css, then put the output JavaScript file in mysite/css/. Putting it in the same folder guarantees all the relative paths in the JavaScript file are maintained.


« Back
Install JavaScript
Next »
Edit Login Information