Как вставить горизонтальные линии между объектами?
Сверстал 5 шагов. В макете между ними есть линии, которые их разделяют. Каким образом я смогу реализовать эти линии и вставить их между шагами? При этом, в макете видно, что эти линии свободно проходят между границами контейнеров.


.steps {
width: 1180px;
height: 455px;
padding-top: 110px;
margin: auto;
}
.steps-header {
font-weight: 500;
font-size: 50px;
line-height: 60px;
text-align: center;
font-family: 'Rubik';
font-style: normal;
color: #444444;
}
.container-navigation__step {
display: flex;
flex-wrap: wrap;
}
.navigation__step {
padding-top: 67px;
width: 220px;
height: 217px;
}
.step-number {
font-weight: 500;
font-size: 50px;
line-height: 40px;
font-family: 'Rubik';
font-style: normal;
text-align: center;
color: #E73D66;
}
.what-to-do__step {
padding-top: 27px;
font-weight: 400;
font-size: 22px;
line-height: 26px;
font-family: 'Rubik';
font-style: normal;
text-align: center;
color: #444444;
}
.text-step {
padding-top: 10px;
font-weight: 300;
font-size: 16px;
line-height: 22px;
font-family: 'Rubik';
font-style: normal;
text-align: center;
color: #444444;
}
<div class="steps">
<h2 class="steps-header">КАК ЗАБРАТЬ ПИТОМЦА ДОМОЙ?</h2>
<div class="container-navigation__step">
<div class="navigation__step">
<h3 class="step-number">1</h3>
<h4 class="what-to-do__step">Выберите питомца</h4>
<p class="text-step">В нашем приюте содержится более 60 собак</p>
</div>
<div class="navigation__step">
<h3 class="step-number">2</h3>
<h4 class="what-to-do__step">Оставьте
заявку</h4>
<p class="text-step">Через сайт или связавшись с нами любым удобным для вас способом</p>
</div>
<div class="navigation__step">
<h3 class="step-number">3</h3>
<h4 class="what-to-do__step">Пройдите
собеседование</h4>
<p class="text-step">Мы заботимся о наших питомцах и отдаем их только в хорошие руки</p>
</div>
<div class="navigation__step">
<h3 class="step-number">4</h3>
<h4 class="what-to-do__step">Познакомьтесь
с собакой</h4>
<p class="text-step">Приезжайте к нам в приют, что бы в живую увидеть вашего питомца</p>
</div>
<div class="navigation__step">
<h3 class="step-number">5</h3>
<h4 class="what-to-do__step">Забирайте
друга домой</h4>
<p class="text-step">Мы поможем вам с транспортировкой</p>
</div>
</div>
</div>
Ответы (3 шт):
Автор решения: Acri
→ Ссылка
Я б переписал полностью css, но мне лень было это делать, ибо css разметку я б по другому делал изначально. Поэтому держи заклёпку:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
.steps {
width: 1180px;
height: 455px;
padding-top: 110px;
margin: auto;
}
.steps-header {
font-weight: 500;
font-size: 50px;
line-height: 60px;
text-align: center;
font-family: 'Rubik';
font-style: normal;
color: #444444;
}
.container-navigation__step {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
#rect{
width: 1000px;
height: 3px;
position: absolute;
background: #e73d66;
z-index: -1;
margin-top: 135px;
}
.navigation__step {
padding-top: 67px;
width: 220px;
height: 217px;
}
.step-number {
margin: 1em 46px;
background: white;
font-weight: 500;
font-size: 50px;
line-height: 40px;
font-family: 'Rubik';
font-style: normal;
text-align: center;
color: #E73D66;
z-index: 10;
}
.what-to-do__step {
padding-top: 27px;
font-weight: 400;
font-size: 22px;
line-height: 26px;
font-family: 'Rubik';
font-style: normal;
text-align: center;
color: #444444;
}
.text-step {
padding-top: 10px;
font-weight: 300;
font-size: 16px;
line-height: 22px;
font-family: 'Rubik';
font-style: normal;
text-align: center;
color: #444444;
}
</style>
</head>
<body>
<div class="steps">
<h2 class="steps-header">КАК ЗАБРАТЬ ПИТОМЦА ДОМОЙ?</h2>
<div class="container-navigation__step">
<div id="rect"></div>
<div class="navigation__step">
<h3 class="step-number">1</h3>
<h4 class="what-to-do__step">Выберите питомца</h4>
<p class="text-step">В нашем приюте содержится более 60 собак</p>
</div>
<div class="navigation__step">
<h3 class="step-number">2</h3>
<h4 class="what-to-do__step">Оставьте
заявку</h4>
<p class="text-step">Через сайт или связавшись с нами любым удобным для вас способом</p>
</div>
<div class="navigation__step">
<h3 class="step-number">3</h3>
<h4 class="what-to-do__step">Пройдите
собеседование</h4>
<p class="text-step">Мы заботимся о наших питомцах и отдаем их только в хорошие руки</p>
</div>
<div class="navigation__step">
<h3 class="step-number">4</h3>
<h4 class="what-to-do__step">Познакомьтесь
с собакой</h4>
<p class="text-step">Приезжайте к нам в приют, что бы в живую увидеть вашего питомца</p>
</div>
<div class="navigation__step">
<h3 class="step-number">5</h3>
<h4 class="what-to-do__step">Забирайте
друга домой</h4>
<p class="text-step">Мы поможем вам с транспортировкой</p>
</div>
</div>
</div>
</body>
</html>
Автор решения: Qwertiy
→ Ссылка
.steps {
margin: auto;
text-align: center;
}
.container-navigation__step {
display: flex;
}
.navigation__step {
flex: 1 0 0px;
padding: 0 .5em;
overflow: hidden;
position: relative;
}
.step-number {
font-weight: 500;
font-size: 50px;
line-height: 40px;
color: #E73D66;
}
.step-number::before, .step-number::after {
content: "";
position: absolute;
width: 100%;
margin-top: 20px;
border-bottom: 1px solid;
}
.step-number::before {
margin-left: calc(-100% - .25em);
}
.step-number::after {
margin-left: .25em;
}
.navigation__step:first-child .step-number::before,
.navigation__step:last-child .step-number::after {
content: none;
}
<div class="steps">
<h2 class="steps-header">КАК ЗАБРАТЬ ПИТОМЦА ДОМОЙ?</h2>
<div class="container-navigation__step">
<div class="navigation__step">
<h3 class="step-number">1</h3>
<h4 class="what-to-do__step">Выберите питомца</h4>
<p class="text-step">В нашем приюте содержится более 60 собак</p>
</div>
<div class="navigation__step">
<h3 class="step-number">2</h3>
<h4 class="what-to-do__step">Оставьте заявку
</h4>
<p class="text-step">Через сайт или связавшись с нами любым удобным для вас способом</p>
</div>
<div class="navigation__step">
<h3 class="step-number">30</h3>
<h4 class="what-to-do__step">Пройдите собеседование
</h4>
<p class="text-step">Мы заботимся о наших питомцах и отдаем их только в хорошие руки</p>
</div>
<div class="navigation__step">
<h3 class="step-number">4</h3>
<h4 class="what-to-do__step">Познакомьтесь с собакой</h4>
<p class="text-step">Приезжайте к нам в приют, что бы в живую увидеть вашего питомца</p>
</div>
<div class="navigation__step">
<h3 class="step-number">5</h3>
<h4 class="what-to-do__step">Забирайте друга домой</h4>
<p class="text-step">Мы поможем вам с транспортировкой</p>
</div>
</div>
</div>
Автор решения: Qwertiy
→ Ссылка
.steps {
margin: auto;
text-align: center;
}
.container-navigation__step {
display: grid;
grid-auto-flow: column;
grid-auto-columns: 1fr;
}
.navigation__step > * {
padding: 0 .5em;
}
.step-number {
font-weight: 500;
font-size: 50px;
line-height: 40px;
color: #E73D66;
padding-inline: 0;
display: grid;
grid-template-columns: 1fr auto 1fr;
grid-gap: .25em;
align-items: center;
}
.step-number::before, .step-number::after {
content: "";
border-bottom: 1px solid;
}
.navigation__step:first-child .step-number::before,
.navigation__step:last-child .step-number::after {
visibility: hidden;
}
<div class="steps">
<h2 class="steps-header">КАК ЗАБРАТЬ ПИТОМЦА ДОМОЙ?</h2>
<div class="container-navigation__step">
<div class="navigation__step">
<h3 class="step-number">1</h3>
<h4 class="what-to-do__step">Выберите питомца</h4>
<p class="text-step">В нашем приюте содержится более 60 собак</p>
</div>
<div class="navigation__step">
<h3 class="step-number">2</h3>
<h4 class="what-to-do__step">Оставьте заявку
</h4>
<p class="text-step">Через сайт или связавшись с нами любым удобным для вас способом</p>
</div>
<div class="navigation__step">
<h3 class="step-number">30</h3>
<h4 class="what-to-do__step">Пройдите собеседование
</h4>
<p class="text-step">Мы заботимся о наших питомцах и отдаем их только в хорошие руки</p>
</div>
<div class="navigation__step">
<h3 class="step-number">4</h3>
<h4 class="what-to-do__step">Познакомьтесь с собакой</h4>
<p class="text-step">Приезжайте к нам в приют, что бы в живую увидеть вашего питомца</p>
</div>
<div class="navigation__step">
<h3 class="step-number">5</h3>
<h4 class="what-to-do__step">Забирайте друга домой</h4>
<p class="text-step">Мы поможем вам с транспортировкой</p>
</div>
</div>
</div>