Как сверстать по сетке уходящий в бок элемент
Пытаюсь сверстать эту часть, получается через одно место, не понимаю как это нормально верстать по дизайнерской сетке. В моём случае сеткой выступает .container
Есть вариант левый и правый элемент сделать absolute, но, мне кажется, такое себе
Вот как нужно сделать:
У меня есть такой вариант, но есть неудобства, я не удобно управляю отступом между блоками с текстом и картинкой
*,
*::before,
*::after {
box-sizing: inherit;
}
html {
box-sizing: border-box;
}
body {
margin: 0;
font-size: 16px;
font-family: 'Roboto', sans-serif;
}
img {
display: block;
max-width: 100%;
max-height: 100%;
}
.container {
max-width: 1094px;
display: block;
margin: 0 auto;
padding: 0 1em;
}
.link {
white-space: nowrap;
text-decoration: none;
color: inherit;
transition-property: color;
transition-timing-function: ease;
transition-duration: 0.2s;
}
.link:hover {
color: #90ee90;
}
.btn {
display: inline-block;
font-size: inherit;
border: none;
outline: none;
color: inherit;
padding: 1em 1.625em;
background-color: inherit;
transition-property: color, background-color;
transition-timing-function: ease;
transition-duration: 0.2s;
}
.btn_green {
background-color: rgb(66, 174, 96);
border-radius: 6px;
}
.btn_green:hover {
background-color: rgb(135, 189, 29);
color: inherit;
}
.intro {
color: white;
background-color: rgb(39, 55, 32);
display: flow-root;
padding: 60px 0;
overflow: hidden;
}
.intro__wrapper {
display: grid;
grid-template-columns: 3fr 3fr;
}
.intro__right {
position: relative;
right: -30%;
}
.intro__right-img {
border-radius: 10px;
max-width: none;
}
<section class="intro">
<div class="container">
<div class="intro__wrapper">
<div class="intro__left">
<h1 class="intro__title">
Security reviews, solved
</h1>
<div class="intro__description">
Using AI and a team of experts, HyperComply automates security reviews and accelerates due diligence, so you can onboard new tools and partners with confidence.
</div>
<a class="btn btn_green link" href="">Get a Demo</a>
</div>
<div class="intro__right">
<img src="https://i.sstatic.net/krEC9.png" alt="" class="intro__right-img">
</div>
</div>
</div>
</section>
Источник: Stack Overflow на русском