I have a line of liquid in which I need to show and hide gaps depending on how the user wants to see the page (single view, split view). Using jQuery, I show / hide gaps and also change their classes:
MySpan1 View:
<div class="row-fluid"> <div id="myspan1" class="span12"></div> <div id="myspan2" style="display:none;"></div> </div>
MySpan2 View (this template is not configured correctly):
<div class="row-fluid"> <div id="myspan1" style="display:none;"></div> <div id="myspan2" class="span12"></div> </div>
Split view:
<div class="row-fluid"> <div id="myspan1" class="span6"></div> <div id="myspan2" class="span6"></div> </div>
I had a problem with the following flexible style sheet rule:
.row-fluid [class*="span"]:first-child { margin-left: 0; }
This rule only removes the left-margin fields in span classes if they are the first child of the parent. Well, in the case of viewing MySpan2, my div is the second child of the parent (although it is the first with the span * class. As a result, the left margin is still applied. Is there a css pseudo selector that will do what I expect? I want to select only the first matching element, whether it is the first parent of the parent, I can fix it with jQuery and some additional css, but I was hoping for a more global resolution.
source share