Как разместить абзац справа от блока изображений?

Я пытаюсь разместить небольшой абзац рядом с 4 изображениями, которые находятся друг над другом.

На данный момент абзац находится под изображениями.

Вот чего я хочу добиться:

https://ntchwaidumela-thomas.pixpa.com/architecture/container-society

Я пытался float, но текст просто сдвинулся вправо, но остался внизу.

  .column img {
  display: block;
  padding: 20px;
  width: 55%;
  height: auto;
}

.column {
  margin-left: 70px;
  display: inline-block;
  margin-bottom: 40px;
}

.para {
  display: inline-block;
  width: 55%;
  font-size: 18px;
  line-height: 30px;
  letter-spacing: 1px;
  text-align: center;
  color: rgba(47, 46, 46, 0.70);
<div class = "row">
  <div class = "column">
    <img id = "img1" src = "architecture/img1.jpg">
    <img id = "img2" src = "architecture/img2.jpg">
    <img id = "img3" src = "architecture/img3.jpg">
    <img id = "img4" src = "architecture/img4.jpg">
  </div>
  <div class = "para">
    <p class = "para"> text text text text text text text text text text text text tetx
      <br><br> text text text text text text text text text text text text tetx<br><br> text text text text text text text text text text text text tetx</p>
  </div>

Я изменил ваш опубликованный код на фрагмент, чтобы его можно было запустить и увидеть на этом сайте. В вашем коде есть опечатки, которые я не исправил (например, отсутствующий символ } в вашем последнем объявлении CSS), не могли бы вы исправить этот код, чтобы он точно отражал вашу проблему. Кроме того, не ожидайте, что люди будут переходить по ссылкам в Интернете, многие люди просматривают сайт на работе и не готовы или не могут рисковать столкнуться с контентом nsfw. Вместо этого создайте изображение, которое показывает желаемый макет, и добавьте его к вопросу.

David Thomas 21.03.2022 19:13
Приемы CSS-макетирования - floats и Flexbox
Приемы CSS-макетирования - floats и Flexbox
Здравствуйте, друзья-студенты! Готовы совершенствовать свои навыки веб-дизайна? Сегодня в нашем путешествии мы рассмотрим приемы CSS-верстки - в...
Введение в CSS
Введение в CSS
CSS является неотъемлемой частью трех основных составляющих front-end веб-разработки.
Как выровнять Div по центру?
Как выровнять Div по центру?
Чтобы выровнять элемент <div>по горизонтали и вертикали с помощью CSS, можно использовать комбинацию свойств и значений CSS. Вот несколько методов,...
Навигация по приложениям React: Исчерпывающее руководство по React Router
Навигация по приложениям React: Исчерпывающее руководство по React Router
React Router стала незаменимой библиотекой для создания одностраничных приложений с навигацией в React. В этой статье блога мы подробно рассмотрим...
Система управления парковками с использованием HTML, CSS и JavaScript
Система управления парковками с использованием HTML, CSS и JavaScript
Веб-сайт по управлению парковками был создан с использованием HTML, CSS и JavaScript. Это простой сайт, ничего вычурного. Основная цель -...
CSS: FlexBox
CSS: FlexBox
Ранее разработчики использовали макеты с помощью Position и Float. После появления flexbox сценарий полностью изменился.
0
1
23
3
Перейти к ответу Данный вопрос помечен как решенный

Ответы 3

Не используйте float в этом случае, так как flex будет лучше подходить даже для того, чтобы сделать его отзывчивым.

.row{
  display:flex;
  padding: 2rem;
}

::-webkit-scrollbar {
    display: none;
}

.Images_section{
  width:50vw;
  height:100vh;
  overflow-y: scroll;
}


.para_section{
  width:50vw;
  overflow-y: scroll;
  line-height:5rem;
  height:100vh;
  background-color: blue;
}
<div class = "row">
  <div class = "Images_section">
    <img src = "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=465&q=80" alt = "Img">
     <img src = "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=465&q=80" alt = "Img">
     <img src = "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=465&q=80" alt = "Img">
     <img src = "https://images.unsplash.com/photo-1503023345310-bd7c1de61c7d?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=465&q=80" alt = "Img">
  </div>
  
  <div class = "para_section">
    Lorem ipsum dolor sit amet consectetur, adipisicing elit. Unde esse mollitia officiis ex tempore quam deserunt porro aut praesentium reprehenderit. Maiores nulla ea qui animi harum dignissimos doloremque corporis, non modi. Omnis facere reprehenderit assumenda ad illo labore corporis eos suscipit debitis veritatis, itaque laudantium nulla dolorem expedita. Et, eius.
    Lorem ipsum dolor sit amet consectetur adipisicing elit. Iure natus quo ducimus consequatur veniam laborum alias incidunt vero dolorum numquam facere voluptatem assumenda, dolore distinctio maxime nisi eaque reiciendis accusantium sint? A veniam pariatur earum eum eius adipisci harum quia sapiente esse, deleniti accusantium! Natus est esse architecto quasi? Temporibus.
  </div>
</div>

Один из подходов заключается в объединении макета CSS Grid и Flex; пояснительные комментарии есть в коде:

/* a simple CSS reset, to ensure that all elements have the
   same box-sizing, margin, padding and font: */

*,
 ::before,
 ::after {
  box-sizing: border-box;
  font: normal 400 18px / 30px sans-serif;
  margin: 0;
  padding: 0;
}


/* here we use display: grid to create two equal-width
   columns (each of which is 1fr, which is one fraction
   of the space available to the grid): */

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* using logical properties to assign the margin;
     margin-block is the block-axis of the document
     (top-to-bottom in English/left-to-right languages);
     margin-inline is the inline-axis (the axis in which
     writing flows, so left-to-right in English): */
  margin-block: 1em;
  margin-inline: auto;
  /* an arbitrary width, adjust to taste: */
  width: 90vw;
}

.column {
  /* here we use display: flex: */
  display: flex;
  /* our flex-flow is set to column, so that the images
     appear one-above-the-other, top-to-bottom: */
  flex-flow: column;
  /* we set a 20px gap between adjacent elements: */
  gap: 20px;
  /* contents are placed horizontally and vertically in
     the center of the element; place-content is a short-hand
     for 'align-content' and 'justify-content' (applying the
     same value - 'center' - to each): */
  place-content: center;
}

div.para {
  /* to ensure position is calculated against this parent element,
     rather than any other ancestor: */
  position: relative;
}

p.para {
  color: rgba(47, 46, 46, 0.70);
  margin-block: 0;
  margin-inline: auto;
  text-align: center;
  width: 90%;
  /* to ensure the p.para element(s) are positioned on-screen as the
     document is scrolled: */
  position: sticky;
  /* defining the vertical-position, in relation to the 'top' border
     of the element: */
  top: 1em;
}
<div class = "row">
  <div class = "column">
    <img id = "img1" src = "architecture/img1.jpg">
    <img id = "img2" src = "architecture/img2.jpg">
    <img id = "img3" src = "architecture/img3.jpg">
    <img id = "img4" src = "architecture/img4.jpg">
  </div>
  <div class = "para">
    <p class = "para"> text text text text text text text text text text text text tetx
      <br><br> text text text text text text text text text text text text tetx<br><br> text text text text text text text text text text text text tetx</p>
  </div>

Рекомендации:

Ответ принят как подходящий

сделать row класс display:flex и height:100vh

.row{
  display:flex;
  height:100vh;
}
.column img {
  display: block;
  padding: 20px;
  width: 80%;
  height: auto;
}

.column {
  height:100vh;
  overflow-y: scroll;
  margin-left: 70px;
  display: inline-block;
  margin-bottom: 40px;
  width: 60%;
}

.para {
  display: inline-block;
  width: 55%;
  font-size: 18px;
  color: rgba(47, 46, 46, 0.70); 
  letter-spacing: 3px;
  line-height: 60px;
  text-align: center;
  
}
<div class = "row">
  <div class = "column">
    <img id = "img1" src = "https://picsum.photos/200">
    <img id = "img2" src = "https://picsum.photos/200">
    <img id = "img3" src = "https://picsum.photos/200">
    <img id = "img4" src = "https://picsum.photos/200">
  </div>
  <div class = "para">
    <p class = "para"> text text text text text text text text text text text text tetx
      <br><br> text text text text text text text text text text text text tetx<br><br> text text text text text text text text text text text text  text text text text text text text text text text text text tetx<br><br> text text text text text text text text text text text text   text text text text text text text text text text text text tetx</p>
  </div>

Другие вопросы по теме