I have a folder with a few background images (one.jpg, two.jpg, three.jpg) , and this markup
<section class="slide" data-bg="one"></section>
<section class="slide" data-bg="two"></section>
<section class="slide" data-bg="three"></section>
Would it be possible somehow just with CSS to do something like this?
.slide{
background-image: url(img/attr(data-bg).jpg);
}
This code isnt working, of course.
attr()
(except you need to quote the strings), but there are no known implementations. Your only way is to hardcode them as oezi suggests. – Renfro