Я знаю, что на этот вопрос уже есть правильный помеченный ответ, но, возможно, другие люди захотят использовать мое решение только для css:
Я хотел, чтобы в контейнере был список предупреждений (в данном случае предупреждений о начальной загрузке), а их граница свернулась. Каждое предупреждение имеет радиус границы, который выглядит довольно глупо, когда все они находятся в одном контейнере. Итак, с помощью margin-top: -1px я сделал их границы разрушенными. В качестве следующего шага я должен был изменить стили первого, каждого предупреждения между последним и последним. И это также должно выглядеть хорошо для одного предупреждения, двух предупреждений и n предупреждений.
.alert {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
margin: 0;
}
// set for the first alert that it should have a rounded top border
.alert:last-child {
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
}
// set for the last alert that it should have a rounded bottom border
// if there is only one alert this will also trigger it to have a rounded bottom border aswell
.alert+.alert:last-child {
margin-top: -1px;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
//for the last border of n alerts we set the top border to be collapsing and remove only the the top rounded borders
.alert+.alert:not(:last-child) {
margin-top: -1px;
border-radius: 0;
}
// for each following alert in between we remove the top rounded borders and make their borders collapse
А вот угловой шаблон для нескольких оповещений.
<div id="alertscontainer">
<div data-ng-repeat="alert in data.alerts" class="alert" data-ng-class="'alert-' + alert.class">
{{alert.body}}
</div>
</div>