В div1 есть div1.2 - почему он отображается не до конца div1

Рейтинг: 0Ответов: 1Опубликовано: 23.02.2023

Помогите пожалуйста я уже 2 часа сижу - весь код переписал не могу понять почему так

введите сюда описание изображения

Расстояние тут нормально не сделать поэтому пишу этот текст

введите сюда описание изображения

body {
  background-color: #171717;
  color: white;
}

/*navbar*/

header {
  height: 100px;
  background-color: #303030;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-right: 30px;
  margin-right: 5%;
  margin-left: 5%;
  box-shadow: 5px 3px 5px 2px #000000;
}

.headerTitle {
  position: absolute;
  margin-right: 40%;
}

a {
  color: white;
  text-decoration: none;
  margin-right: 16px;
}

a:hover {
  color: #808080;
}

/*about_person*/

.person_title {
  margin-left: 4%;
  margin-top: 4%;
}

.person_title * {
  margin: 0;
}

.person_title .personName {
  font-size: 32px;
  margin-bottom: 0.5%;
}

.person_title .personQualification {
  color: red;
  font-family: Arial;
  font-size: 20px;
}

.person_info {
  display: flex;
  justify-content: flex-start;
  background-color: #303030;
  margin-left: 4%;
  margin-right: 4%;
  margin-top: 0.5%;
}

.personImg {
  width: 100%;
  max-width: 50%;
  object-fit: contain;
  max-height: 450px;
}

.person_description * {
  margin: 0;
  margin-left: 2%;
  margin-top: 1%;
}

.person_description h2 {
  font-size: 28px;
}

.person_description p {
  font-size: 18px;
}

.person_links {
  display: flex;
  flex-flow: column;
  margin-top: 1%;
  margin-left: 0%;
}

.person_links .button {
  padding: 10px;
  background-color: #0900FF;
  border-radius: 6px;
  width: 30%;
}

.cellar {
  margin-left: 4%;
  font-size: 16px;
}

.bold {
  font-weight: 800;
}
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>MyFirstSite_copy_2_2</title>
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <header>
    <h1 class="headerTitle">Influencers</h1>
    <h4 class="headerLinks">
      <a href="#">Home</a>
      <a href="#">Contact</a>
      <a href="#">About</a>
    </h4>
  </header>
  <div class="about_person">
    <div class="person_title">
      <h2 class="personName">Egor Chulkov</h2>
      <p class="personQualification">German coach</p>
    </div>
    <div class="person_info">
      <img class="personImg" src="Egor.png" alt="">
      <div class="person_description">
        <h2>About Egor</h2>
        <p>Egor its a German language coach</p>
        <p>Expirience:6 years</p>
        <p>Goethe certificat:C2</p>
        <p>Skype:1 hour</p>
        <p>Price:55$</p>
        <div class="person_links">
          <a href="#" class="button">Exercises</a>
          <a href="https://www.youtube.com/playlist?list=PLX3dX7kmwqlDHvgp1dDxuvulDDdRtLQ9T" class="button">Videos</a>
          <a href="https://deutsch-mit-yehor.com/" class="button">Site</a>
        </div>
      </div>
    </div>
  </div>
  <div class="about_person">
    <div class="person_title">
      <h2 class="personName">Michail Raduga</h2>
      <p class="personQualification">Faze state</p>
    </div>
    <div class="person_info">
      <img class="personImg" src="Raduga.jpg" alt="">
      <div class="person_description">
        <h2>About Michail</h2>
        <p>Michail its a faze state practic.He also have a book and teach people how to get in luquid dream</p>
        <p>Expirience:22 years</p>
        <p>Book:<a href="https://www.ozon.ru/product/faza-vzlamyvaya-illyuziyu-realnosti-raduga-mihail-227780671/">
                    Faze</a></p>
        <p>Price:12.6$</p>
      </div>
    </div>
  </div>
  <div class="cellar">
    <p>MyFirstSite_copy_2_2: <span class="bold">21.02.2023 - 23.02.2023</span></p>
  </div>
</body>
</html>
Я просто хочу чтобы этот текст был до конца введите сюда описание изображения


.person_description {
    width: 100%;
}

Надо чтобы было width у div который обозначил на картинке зелёным тоже было width:50%;

введите сюда описание изображения

Ответы

▲ 0

По идее так должно быть

body {
  background-color: #171717;
  color: white;
}

/*navbar*/

header {
  height: 100px;
  background-color: #303030;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-right: 30px;
  margin-right: 5%;
  margin-left: 5%;
  box-shadow: 5px 3px 5px 2px #000000;
}

.headerTitle {
  position: absolute;
  margin-right: 40%;
}

a {
  color: white;
  text-decoration: none;
  margin-right: 16px;
}

a:hover {
  color: #808080;
}

/*about_person*/

.person_title {
  margin-left: 4%;
  margin-top: 4%;
}

.person_title * {
  margin: 0;
}

.person_title .personName {
  font-size: 32px;
  margin-bottom: 0.5%;
}

.person_title .personQualification {
  color: red;
  font-family: Arial;
  font-size: 20px;
}

.person_info {
  display: flex;
  justify-content: flex-start;
  column-gap: 2%;
  background-color: #303030;
  margin-left: 4%;
  margin-right: 4%;
  margin-top: 0.5%;
}

.personImg {
  width: 100%;
  max-width: 50%;
  object-fit: contain;
  max-height: 450px;
}

.person_description * {
  margin: 0;
  margin-top: 1%;
}
.person_description {
  width: 48%;
}
.person_description h2 {
  font-size: 28px;
}

.person_description p {
  font-size: 18px;
}

.person_links {
  display: flex;
  flex-flow: column;
  margin-top: 1%;
  margin-left: 0%;
}

.person_links .button {
  padding: 10px;
  background-color: #0900FF;
  border-radius: 6px;
  width: 30%;
}

.cellar {
  margin-left: 4%;
  font-size: 16px;
}

.bold {
  font-weight: 800;
}
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>MyFirstSite_copy_2_2</title>
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <header>
    <h1 class="headerTitle">Influencers</h1>
    <h4 class="headerLinks">
      <a href="#">Home</a>
      <a href="#">Contact</a>
      <a href="#">About</a>
    </h4>
  </header>
  <div class="about_person">
    <div class="person_title">
      <h2 class="personName">Egor Chulkov</h2>
      <p class="personQualification">German coach</p>
    </div>
    <div class="person_info">
      <img class="personImg" src="Egor.png" alt="">
      <div class="person_description">
        <h2>About Egor</h2>
        <p>Egor its a German language coach</p>
        <p>Expirience:6 years</p>
        <p>Goethe certificat:C2</p>
        <p>Skype:1 hour</p>
        <p>Price:55$</p>
        <div class="person_links">
          <a href="#" class="button">Exercises</a>
          <a href="https://www.youtube.com/playlist?list=PLX3dX7kmwqlDHvgp1dDxuvulDDdRtLQ9T" class="button">Videos</a>
          <a href="https://deutsch-mit-yehor.com/" class="button">Site</a>
        </div>
      </div>
    </div>
  </div>
  <div class="about_person">
    <div class="person_title">
      <h2 class="personName">Michail Raduga</h2>
      <p class="personQualification">Faze state</p>
    </div>
    <div class="person_info">
      <img class="personImg" src="Raduga.jpg" alt="">
      <div class="person_description">
        <h2>About Michail</h2>
        <p>Michail its a faze state practic.He also have a book and teach people how to get in luquid dream</p>
        <p>Expirience:22 years</p>
        <p>Book:<a href="https://www.ozon.ru/product/faza-vzlamyvaya-illyuziyu-realnosti-raduga-mihail-227780671/">
                    Faze</a></p>
        <p>Price:12.6$</p>
      </div>
    </div>
  </div>
  <div class="cellar">
    <p>MyFirstSite_copy_2_2: <span class="bold">21.02.2023 - 23.02.2023</span></p>
  </div>
</body>
</html>