Scenario
html
<div id='fractal'>
<div class='centerdotline'>
<span>Some text</span>
</div>
</div>
css
#fractal {
background-image:url('fractal.jpg');
background-repeat: repeat;
}
.centerdotline {
background-image:url('dotline.png'); /* with alpha channel */
background-repeat: repeat-x;
background-position: center;
}
.centerdotline span {
padding: 0 20px;
/*
override centerdotline background-image
*/
}
I want to remove centerdotline div ( parent ) background-image but not fractal div background-image.
I can’t set the background-image in this element (like a piece of fractal.jpg) because I don’t know the element’s exact position in relation to the fractal div
Thanks for help
Marco
Perhaps This Workaround
Not knowing specifically what your parameters are, the following solution may or may not be useful to you. I offer it, however, in case it is useful for your situation.
Here is the fiddle example. HTML is just as you had it. I removed the
line-heighton thespanthat you said was not necessary. If you were doing that, you would need to adjust the pseudo-elementheightaccordingly below. That height should roughly matchline-height, which is typically about1.1or1.2, but if set to500pxwould need to be thatheightfor the pseudo-elements.CSS