html - how to select a class which is children of many elements -
<div class="rightsidebox"> <div class="item-info-list"> <p>model: aidcu</p> <div class="product-details"> <p></p> <div class="price-box"> <span class="regular-price" id="product-price-1617-related"> <span class="price">$8.99</span></span> </div> <p></p> </div> </div>
i want make style price , make color green in case in rightbox div , want use css , cannot change structure because theme , should not have conflict other prices in other themes
i can use div.rightsidebox>div.item-info-list
but cannot go further because of paragraph in there how can solve it? have weakness in using ">" , multiple classes in each other
.rightsidebox .price { color: green !important; } // important override other styles
edit: usage of > - selectorr
the element>element selector used select elements specific parent. note: elements not directly child of specified parent, not selected. more info
Comments
Post a Comment