Ahmed Hegazy
Ahmed Hegazy

Reputation: 12605

I can't acess CSS file from sub-sub-category

I can access this CSS stylesheet from sub-category (folder) by:

<link rel="stylesheet" type="text/css" href="../style.css" />

What can I do with sub-sub-category?

Upvotes: 1

Views: 80

Answers (3)

Philip
Philip

Reputation: 4592

create a base path to your assets folder, then create a tag

<base href="base_path_via_server_side" >

Upvotes: 2

Pankaj Upadhyay
Pankaj Upadhyay

Reputation: 13574

To go to a parent directory up in hierarchy you need to add ../ Therefore to go to a parent of parent, you need to add ../../

The shortcut method is to go to root directory which is done by adding / and then traversing the directory you want to access. This is a preferred and less error prone (soothes the eye) than above.

Upvotes: 0

Ayman Safadi
Ayman Safadi

Reputation: 11552

Instead of typing the path as:

../../css/style.css

type it like:

/css/style.css

Upvotes: 3

Related Questions