문제

I have the following HTML:

<div class="tocolor">tocolor 1
<div id="one">tocolor 11</div>
</div>
<div class="mplampla"><span id="two">
</span>tocolor 2</div>
<div class="tocolor-2"><span id="three">
</span>tocolor 3</div>
<div class="tocolor tocolor-1">tocolor 4 
<span id="one">tocolor 44</span>
</div>

and I want to style (let's say color green) "tocolor 11" using a combination of atrribute selectors. I tried the following CSS but it doesn't do anything

div[class*='tocolor'][div[id*='one']] {
color:green
}

Thanks

도움이 되었습니까?

해결책

Used to this

div[class*='tocolor'] div[id*='one'] {
    color:green
    }

and this

 div[class*='tocolor'] > div[id*='one'] {
        color:green
        }

Demo

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top