Dynamic URLs in CSS/JS

后端 未结 9 894
别跟我提以往
别跟我提以往 2021-02-05 16:14

I\'m splitting up one of my larger apps and introducing a \'cdn\' url to house common objects like CSS, javascript, and images to avoid duplication. What I need to do, though, i

9条回答
  •  太阳男子
    2021-02-05 16:38

    Just use domain-relative url's?

    .cool-button { background-image: url('/images/button.png'); }
    

    Then the browser will look under the current domain.

提交回复
热议问题