Вы можете попробовать, как показано ниже:
Я использовал 80px
вместо 700px
, чтобы мы могли увидеть результат в уменьшенном фрагменте.Я также рассмотрел различное количество вертикальных полосок, чтобы показать, что вы можете легко изменить их для каждого раздела:
body {
margin:0;
height:100vh;
background:
linear-gradient(to right,
blue calc(100% - 2px), red calc(100% - 2px) 100%) left top
/calc((100% + 2px)/4) 80px,
linear-gradient(to right,
orange calc(100% - 2px), purple calc(100% - 2px) 100%) left bottom
/calc((100% + 2px)/6) calc(100% - 80px);
background-repeat:repeat-x;
}
Если вам нужен градиент вместо сплошного цвета между вертикальными линиями, вы можете рассмотреть больше градиента:
body {
margin:0;
height:100vh;
background:
/* Top layer*/
linear-gradient(to right,
transparent calc(100% - 2px), red calc(100% - 2px) 100%) left top
/calc((100% + 2px)/4) 80px,
linear-gradient(60deg,blue,lightblue) left top/100% 80px,
/* Bottom layer*/
linear-gradient(to right,
transparent calc(100% - 2px), purple calc(100% - 2px) 100%) left bottom
/calc((100% + 2px)/6) calc(100% - 80px),
linear-gradient(160deg,orange,green) left bottom/100% calc(100% - 80px);
background-repeat:repeat-x;
}
С некоторой переменной CSS для облегчения управления значениями:
body {
--nt:4; /* Number of vertical lines on the top*/
--lt:2px; /* Thickness*/
--nb:6; /* Number of vertical lines on the bottom*/
--lb:4px; /* Thickness*/
--h:100px; /*height of the top part*/
margin:0;
height:100vh;
background:
/* Top layer*/
linear-gradient(to right,
transparent calc(100% - var(--lt)), red calc(100% - var(--lt)) 100%) left top
/calc((100% + var(--lt))/var(--nt)) var(--h),
linear-gradient(60deg,blue,lightblue) top/100% var(--h),
/* Bottom layer*/
linear-gradient(to right,
transparent calc(100% - var(--lb)), purple calc(100% - var(--lb)) 100%) left bottom
/calc((100% + var(--lb))/var(--nb)) calc(100% - var(--h)),
linear-gradient(160deg,orange,green) bottom/100% calc(100% - var(--h));
background-repeat:repeat-x;
}
Также обратите внимание, что в случае сплошной окраски вам не нужно определять высоту нижней части, поскольку она будет перекрываться верхней частью
body {
--nt:4; /* Number of vertical lines on the top*/
--lt:2px; /* Thickness*/
--nb:6; /* Number of vertical lines on the bottom*/
--lb:4px; /* Thickness*/
--h:100px; /*height of the top part*/
margin:0;
height:100vh;
background:
/* Top layer*/
linear-gradient(to right,
transparent calc(100% - var(--lt)), red calc(100% - var(--lt)) 100%) left top
/calc((100% + var(--lt))/var(--nt)) var(--h),
linear-gradient(60deg,blue,lightblue) top/100% var(--h),
/* Bottom layer*/
linear-gradient(to right,
transparent calc(100% - var(--lb)), purple calc(100% - var(--lb)) 100%) left bottom
/calc((100% + var(--lb))/var(--nb)) 100%,
linear-gradient(160deg,orange,green) ;
background-repeat:repeat-x;
}