.pagination__pages span.ng-scope:first-of-type + a {
display: none;
}
<div ng-if="pagination.totalPages > 1" class="pagination pagination-collection ng-scope">
<div class="hide-loading grid-x align-center align-middle">
<div class="pagination__pages cell shrink">
<a ng-if="pagination.totalPages > 5 && pagination.currentPage > 3" href="#" class="ng-binding ng-scope" ss-ps="">1</a>
<span ng-if="pagination.totalPages > 5 && pagination.currentPage > 3" class="ng-scope">...</span>
<a ng-repeat-start="page in pagination.getPages(5) track by $index" ng-if="!page.active" href="#" class="ng-binding ng-scope" ss-ps="">2</a>
<a ng-repeat-start="page in pagination.getPages(5) track by $index" ng-if="!page.active" href="#" class="ng-binding ng-scope" ss-ps="">3</a>
<span ng-repeat-end="" ng-if="page.active" class="ng-binding ng-scope">4</span>
<a ng-repeat-start="page in pagination.getPages(5) track by $index" ng-if="!page.active" href="#" class="ng-binding ng-scope" ss-ps="">5</a>
<a ng-repeat-start="page in pagination.getPages(5) track by $index" ng-if="!page.active" href="#" class="ng-binding ng-scope" ss-ps="">6</a>
<span ng-if="pagination.totalPages > 5 && pagination.currentPage < (pagination.totalPages - 2)" class="ng-scope">...</span>
<a ng-if="pagination.totalPages > 5 && pagination.currentPage < (pagination.totalPages - 2)" href="#" class="ng-binding ng-scope" ss-ps="">51</a>
</div>
</div>
</div>
I've this pagination and I'm trying to remove the elements which come immediately after and before a particular class.
Here's the illustration
As you can see, I'm trying to remove '2' and '6' that come after and before '...'.
I can hide the first one but having trouble trying to hide the 'previous sibling' for second one.
I'd prefer CSS solution if possible, if there isn't one then with JavaScript or jQuery is fine too.
Any help is highly appreciated.