I have a central part of the page.
I want it to be like in the picture. However, I can’t set 2 blocks so that they divide the page in half between them.
In place of this, the text cuts off the image.
.wrapper {
display: inline-flex;
flex: 1;
}
.text__main {
padding: 10px;
min-width: 10%;
}
.img__central {
height: 800px;
width: auto;
}
img {
width: 100%;
/* Ширина изображений */
height: 100%;
/* Высота изображении */
object-fit: cover;
/* Вписываем фотографию в область */
}
h1 {
font-size: 56px;
}
span {
font-size: 30px;
}
button {
width: 100%;
font-size: 30px;
border-radius: 20px;
background-color: blue;
}
<div>
<div class="wrapper">
<div class="text__main">
<h1>Умное образование</h1>
<span>
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Non dolorem, autem reiciendis quibusdam mollitia consequatur similique sapiente quia nisi eos optio voluptatibus rem ut voluptates quaerat ad eaque in labore?
</span>
<button><a href="">НАчать обучение</a></button>
</div>
<div class="img__central ">
<img src="/assets/img/mainslider/02.jpg" alt="">
</div>
</div>
</div>
3
Answers
You can use
flex-grow
which will give two elements with the same value the same space. There is shortcut for flex-grow:flex: <flex-grow> <flex-shrink> <flex-basis>;
https://developer.mozilla.org/en-US/docs/Web/CSS/flex-grow
Use a flexbox. Adjust margins/padding as it fits you.
Bootstrap framework is used.
In the below example If you want that responsiveness that if width of screen is below 576px the column width will be of 100% and if screen width is greater the 576px the row will have two columns 50%(1st column) and %50(2nd column) the use :
div class="col-sm-12 col-md-6"