Front-end - How to solve the background problem by merging multiple css addresses with nginx?
某草草
某草草 2017-05-16 17:08:14
0
2
447

Node+Nginx project, the page uses http://cdn/project1/a.css, pro... such an address refers to css,
Each css may have a background with a relative path, such as background :url(./images/logo.png), after merging, the image path will report an error. Is there any way to solve it?

某草草
某草草

reply all(2)
我想大声告诉你
  1. Use absolute paths if possible

  2. If you cannot use absolute paths and cannot mix css from different directories, you can call them separately

    http://cdn/??a.css
    http://cdn/project/??1.css,2.css
  3. Build the same environment locally for testing, apache also has the concat component

曾经蜡笔没有小新

The relative path of the css file must be obtained based on the current css file. Just hang the corresponding pictures in the relative position on the cdn.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!