javascript - CSS line break after n list item `inline-block` -
i have problem add line break after n (3 example) elements of list: have tried q/a solution (using :nth-child(3):after { content:"\a"; white-space:pre; }) tells id didn't work me.
here css
.lk-color-chooser { list-style-type: none; padding-left: 0; } .lk-color-chooser__color { display: inline-block; width: 30px; height: 30px; border-radius: 50%; margin-right: 5px; cursor: pointer; opacity: 0.5; filter: alpha(opacity=50); } .lk-color-chooser__color:hover, .lk-color-chooser__color.selected { opacity: 1; filter: alpha(opacity=100); } .lk-color-chooser__color:last-child { margin-right: 0; } here plunker code done in angular problem css one.
here 1 of list element : <li class="lk-color-chooser__color ng-scope ng-isolate-scope" style="background-color: #72c2ff" ng-repeat="color in colors track $index" color="color" ng-class="{'selected': selectedcolor == color}"> </li>
thanks in advance,
the problem stems css's nth child selector , display: inline-block/block combination.
you may want css fix this, , i'm sure exists, works. it's if you're concerned inline conditional.
i made span few lines people wouldn't have scroll see code fixes it.
this fixed via 1 change in template:
template: '<ul class="lk-color-chooser"> <lk-color ng-repeat-start="color in colors track $index" color="color" ng-class="{\'selected\': selectedcolor == color}"> </lk-color>{{$index}} <br ng-if="($index + 1) % 3 == 0" ng-repeat-end> </ul>', 
Comments
Post a Comment