あるクラスからあるクラスまでの範囲の要素にCSSを追加するには?いくつかのクラスからあるクラスまでの範囲の要素にCSSを追加するには
私は要素の下にあります
[roletype~='start-content']{
border-top: 1px solid blue;
border-left:1px solid blue;
border-right:1px solid blue;
margin:0;
}
[roletype~='start-content']~* {
border-left:1px solid blue;
border-right:1px solid blue;
margin:0;
}
[roletype~='end-content']{
border-bottom: 1px solid blue;
border-left:1px solid blue;
border-right:1px solid blue;
margin:0;
}
<p roletype="role start-content">sdfdfsdddsd</p>
<p>sdfsddfsdds</p>
<p>sdfsddfsdds</p>
<p>sdfsddfsdds</p>
<p>sdfsddfsdds</p>
<p>sdfsddfsdds</p>
<div roletype="role end-content">sdfdfsdddsd</div>
<div>any div which does not want border<br>but the border is still vissible to this also</div>
<p>any div which does not want border<br>but the border is still vissible to this also</p>
<p>any div which does not want border<br>but the border is still vissible to this also</p>
<div roletype="role start-content">sdfdfsdddsd</div>
<p>sdfsddfsdds</p>
<p>sdfsddfsdds</p>
<p>sdfsddfsdds</p>
<p>sdfsddfsdds</p>
<p>sdfsddfsdds</p>
<div roletype="role end-content">sdfdfsdddsd</div>
私はCSSのボーダー左を追加したい:1pxのソリッドブルー;開始コンテンツから終了コンテンツまでの範囲のすべての要素に適用されます。それはjavascriptの、jqueryのソリューションを知っているonly..I CSSのソリューションを探して、箱のようになります
...
を使用することができないだけで
p
ある場合。 –