Omar Gonzales February 2016

Slidify: How to call image as background from assets/img folder?

I want to call an image from the assets/img folder, becuase I want to share the deck in a ZIP and therefore they won't have the same path as I do for my files.

I've modify the "slidify.css" file, as usual, but with a path to the assets/img folder.

This is the path where the CSS is:

D:\presentaciones\prueba\libraries\frameworks\io2012\css

Path to the image:

D:\presentaciones\prueba\assets\img

Path to index:

D:\presentaciones\prueba

These were my attemps:

1.-

.title-slide {
  background-color: white;
  background-image:url("assets/img/star-bg.png");
}

2.-

.title-slide {
  background-color: white;
  background-image:url(assets\\img\\star-bg.png);
}

3.-

.title-slide {
  background-color: white;
  background-image:url("assets\\img\\star-bg.png");
}

4.-

.title-slide {
  background-color: white;
  background-image:url(".\\assets\\img\\star-bg.png");
}

5.-

.title-slide {
  background-color: white;
  background-image:url("..\\assets\\img\\star-bg.png");
}

Answers


LGSon February 2016

As the css file is in folder path /libraries/frameworks/io2012/css/, it needs to go up 4 levels before it can see /assets/img/, so it should be

/* relative path */
background-image: url('../../../../assets/img/star-bg.png');

or you should be able to use

/* absolute path */
background-image: url('/presentaciones/prueba/assets/img/star-bg.png');

Post Status

Asked in February 2016
Viewed 3,631 times
Voted 12
Answered 1 times

Search




Leave an answer