http://codepen.io/leongaban/pen/KpZxKG?editors=110
I'm trying to add a border style to the li that contains a div with a
certain class. In this case .text-trans-normal
.
Is there a conditional that exists to accomplish this?
The Codepen above was just an example, below is my actual markup with Angular syntax involved:
<ul ng-show="loadingTickersDone" class="tickers-list">
<li ng-repeat="ticker in tickers"
id="{{ticker.ticker}}"
ng-hide="ticker.removed"
ng-class="{'selected':ticker.selected}">
<div class="ticker"
ng-click="unselectAll(); selectTicker('top', ticker); ticker.selected = !ticker.selected;"
ng-class="{'text-trans-normal' : ticker.ticker == 'All'}"
ng-if="ticker.ticker != 'ALL'"
>
{{ticker.ticker}}
</div>
</li>
</ul>
CSS
.button {
float: left;
overflow: hidden;
position: relative;
margin: 0 10px 10px 0;
padding: 9px 10px;
width: auto;
cursor: pointer;
text-transform: uppercase;
clear: both;
color: white;
border: 1px solid #ccc;
background: gray;
border-radius: 5px;
}
.text-trans-normal {
text-transform: initial !important;
/* border-bottom: 1px solid black; */
}
li.text-trans-normal {
border-bottom: 1px solid black;
}
I know I could use li:first-child in this case, but there is another reason why I can't do that, so looking for a different solution here.