alonblack alonblack - 4 years ago 96
CSS Question

More then items selector

I want to select items based on how many divs the wrapper contains.
(if "FilterEquipmentByBarcodePage" contains more then 3 "form row")

Here is the jsfiddle link:

<div id="FilterEquipmentByBarcodePage">

<div class="form_row">
<div>
<input type="Text" name="Summary" class="filter_summary_search_input">
</div>
</div>

<div class="form_row">
<div>
<input type="Text" name="Summary" class="filter_summary_search_input">
</div>
</div>

<div class="form_row">
<div>
<input type="Text" name="Summary" class="filter_summary_search_input">
</div>
</div>

</div>

Answer Source

You can affect items based on their quantity with CSS only with quantity queries.

Here's a great article on quantity queries

You'll want to use the nth-last-child selector with the quantity of n. In your case n+4.

Here's a jsfiddle.

I'm not sure what you mean with you want to "select items". If my example above helps great, else try explaining what you want to do exactly and I might be able to update my code.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download