@hooli-gun

Как сделать так что бы блок с сылками не заходил за секции?

<div class="tabs">
  <a href="#about-1" class="tabs__link">section 1</a>
  <a href="#about-2" class="tabs__link">section 2</a>
  <a href="#about-3" class="tabs__link">section 3</a>
</div>
<section id="about-1" class="page__section wrapper">
  <h2>Lorem Ipsum 1</h2>
  <p>Lorem Ipsum100</p>
</section>
<section id="about-2" class="page__section wrapper">
  <h2>Lorem Ipsum 2</h2>
  <p>Lorem Ipsum100</p>
</section>
<section id="about-3" class="page__section wrapper">
  <h2>Lorem Ipsum has 3</h2>
  <p>Lorem Ipsum100</p>
</section>

.tabs {
  position: sticky;
  top: 0;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  border-bottom: 1px solid #000;
  background-color: #f00;
}

.wrapper {
  max-width: 600px;
  margin: 0 auto;
}
  • Вопрос задан
  • 61 просмотр
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы
02 мая 2024, в 21:59
15000 руб./за проект
02 мая 2024, в 21:54
1000 руб./в час
02 мая 2024, в 21:27
300000 руб./за проект