gwenael
gwenael

Reputation: 15

clojurescript re-frame CSS link path changing with URL

I have a trouble with the import of my CSS - which is made through the html link tag. <link rel="stylesheet" href="styles/main.css">

It works well when the url has got a single slash - like http://url/page. it correctly look for the css at http://url/styles/main.css

but when the URL comports two slashes like http://url/page/1 then the css is looked at: http://url/page/styles/main.css and so is not found cause path is incorrect.

I am using clojurescript react-js wrapper called re-frame.

How to tell the soft to always look at http://url/styles/main.css whatever the URL.

Thanks in advance for your help

Upvotes: 0

Views: 177

Answers (1)

Eugene Pakhomov
Eugene Pakhomov

Reputation: 10632

Your <link ...> is using a relative URL. Relative to the current page, that is.

Just change it to an absolute one by adding / at the front - "/styles/main.css".

Upvotes: 1

Related Questions