0

I need to apply the style for parent div tag based on child class. In the below code class(jqx-grid-group-expand) contains in the first position so parent tag(row0grid) display text color is red. In second(jqx-grid-group-expand) contains in the second position of the parent tag (row1grid) disply the text color is blue. I need to apply the style only in css. no need jQuery. Please help me. Am so trouble of this style. No need jQuery or other styles. because this coding is part of my grid code. grid controls have expand and collapse operation.

Please Help me. I need the style in css only.

 <div style="width: 100%; float: left; display: block;" role="row" id="row0grid">
    <div class=" jqx-grid-group-cell jqx-grid-cell-pinned jqx-grid-group-expand jqx-icon-arrow-down">
    </div>
    <div class=" jqx-grid-group-cell">
    </div>
    <div class=" jqx-grid-group-cell">
        Department: Dept1</div>
    <div class=" jqx-grid-group-cell">
    </div>
    <div class=" jqx-grid-group-cell">
        99</div>
    <div class=" jqx-grid-group-cell" title="">
        135.6</div>
</div>
<div style="width: 100%; float: left; display: block;" id="row1grid">
    <div class=" jqx-grid-group-cell">
    </div>
    <div class=" jqx-grid-group-cell jqx-grid-cell-pinned jqx-grid-group-expand jqx-icon-arrow-down">
    </div>
    <div class=" jqx-grid-group-cell">
        Department: Dept1</div>
    <div role="gridcell" class=" jqx-grid-group-cell">
    </div>
    <div class=" jqx-grid-group-cell">
        99</div>
    <div class=" jqx-grid-group-cell" title="">
        135.6</div>
</div>
sona
  • 123
  • 3
  • 13
  • You cannot apply styles to a parent based on the child. CSS doesn't work that way. You need javascript. – sharf Jul 17 '14 at 04:17
  • Hi, No need javascript and jQuery. Because this is not full data, part of coding only. its working in jQuery. but am extract the datagrid the styles is removing otherwise its style appearing first child also. That's why am need css. Any alternative please inform. Thanks. – sona Jul 17 '14 at 04:28
  • You want to change a parent div's style based on the class of one of its child's classes? – sharf Jul 17 '14 at 04:32

0 Answers0