Is there a convenient way to set the background image of a pseudo element via data attributes?
I'm trying to achieve something like this, but i want to be able to set the background image in the markup via my CMS:
.full-width {
background-color: #ededed;
width: 100%;
position: relative;
z-index: -1;
}
.full-width:after {
content: '';
display: block;
position: absolute;
width: 50%;
height: 100%;
left: 50%;
top: 0;
background-image: url(//unsplash.it/1080/1920);
background-size: cover;
background-position: left center;
z-index: -1;
}
.full-width .container {
z-index: 99;
}
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet" />
<div class="full-width">
<div class="container">
<div class="row">
<div class="col-xs-6">
<h2>Test 123</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
</div>
</div>
</div>
not directly a duplicate of How can I use a data attribute to set a background-image in CSS? because i'm talking about pseudo elements. Thanks for linking me up with this, but I was already aware of these techniques.