3

В списке под каждым li стоит border-bottom, но он не распространяется на маркер. Можно ли как то подчеркнуть li вместе с маркером?

2 ответа 2

2

Как вариант через псевдоэлемент:

* {
  margin: 0;
  padding: 0;
}

.wrapper {
  margin: 1rem;
}

ul li {
  position: relative;
  padding: 0.85rem;
  list-style-type: none;
  border-bottom: 1px solid;
}

li::before {
  content: "•";
  position: absolute;
  left: 5px;
}
<div class="wrapper">
  <ul>
    <li>Lorem</li>
    <li>Ipsum</li>
    <li>Dolor</li>
    <li>Amet</li>
  </ul>
</div>

0

Генерировать вручную?

li {
  border-bottom: 1px solid #000;
}
li:before {
  content: attr(data-number);
}
<ol>
  <li data-number="1"></li>
  <li data-number="2"></li>
  <li data-number="3"></li>
  <li data-number="4"></li>
</ol>

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.