0

Здраствуйте, есть у меня страничка. В ней есть фон, так вот если текста слишком много она просто залезает за фон. Как сделать так что б фон автоматом продолжился в них за текстом

<!DOCTYPE html>
<html lang="ru" dir="ltr">
  <head>
    <link rel="preconnect" href="https://fonts.gstatic.com">
    <link href="https://fonts.googleapis.com/css2?family=Leckerli+One&display=swap" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Jura:wght@300&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="css/style.css">
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>
    <div class="head">
      <h1 class="logo">BaseSec</h1>
      <div class="vl"></div>
      <a class="link" href="#">НОВОСТИ</a>
      <a class="link" href="#">СТАТЬИ</a>
      <a class="link" href="#">ПРОФИЛЬ</a>
    </div>
    <div class="foot">
      <h2 class="name">Сайт кибер безопастности BaseSec</h2>
      <p class="text">Данный сайт создан для того что бы специалисты по кибер безопастности по всей России делились своими знаниями и опытом.</p>
      <p class="text">На BaseSec можно найти различные интересные статьи на тему безопастности, а так же создать свои</p>
      <p class="text">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
      <p class="text">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
      <p class="text">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
    </div>
  </body>
</html>



.logo {
  float: left;
  margin-top: 0;
  margin-bottom: 0;
  width: 248px;

  font-family: 'Leckerli One', cursive;
  font-weight: normal;
  font-size: 64px;
  color: #F34A4A;
  -webkit-touch-callout: none; /* iOS Safari */
  -webkit-user-select: none;   /* Chrome/Safari/Opera */
  -khtml-user-select: none;    /* Konqueror */
  -moz-user-select: none;      /* Firefox */
  -ms-user-select: none;       /* Internet Explorer/Edge */
  user-select: none;           /* Non-prefixed version, currently */
}
.head {
  width: 100%;
  height: 87px;

  background: #222F34;
}
/*.main {
  background: #615049;
  display: flex;
  width: 100%;
  height: 100%;
}*/
.vl {
  float: left;
  padding-left: 1%;
  margin-top: 5px;
  margin-bottom: 2px;
  border-left: 6px solid #F1D3BC;
  height: 76px;
  width: 2px;
}
.link {
  -webkit-touch-callout: none; /* iOS Safari */
  -webkit-user-select: none;   /* Chrome/Safari/Opera */
  -khtml-user-select: none;    /* Konqueror */
  -moz-user-select: none;      /* Firefox */
  -ms-user-select: none;       /* Internet Explorer/Edge */
  user-select: none;           /* Non-prefixed version, currently */

  display:inline-block;
  margin-top: 10px;
  padding-left: 30px;
  font-family: 'Jura', sans-serif;
  font-weight: bold;
  font-size: 48px;

  color: #F34A4A;
  height: 63px;
}
.link:hover {
  color: #d83232;
}
body {
  margin: 0;
  background: #615049;
}
a {
    text-decoration: none; /* Отменяем подчеркивание у ссылки */
}
.foot{
  width: 1564px;
  height: 790px;

  background: #F1D3BC;
  border-radius: 53px;
  margin: 60px;
}
.text {
  margin: 0px;
  font-family: 'Jura', sans-serif;
  padding: 1.5%;
  font-style: normal;
  font-weight: normal;
  font-size: 30px;
  line-height: 43px;

  color: #222F34;

  text-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
}
.name {
  margin: 0px;
  padding-top: 20px;
  padding-left: 25px;
  font-family: 'Jura', sans-serif;
  font-style: normal;
  font-weight: bold;
  font-size: 30px;
  line-height: 43px;

  color: #F34A4A;

  text-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
}
2
  • вы же для .foot указали фиксированную высоту - удалите и блок по высоте будет тянуться, да и width писать в таком стиле тоже не айс - пишите max-width 7 дек 2020 в 0:02
  • вот так вроде туда сюда: codepen.io/topicstarter/pen/wvzGOKp но не ясно откуда у лого рядом с меню отступ - 7 дек 2020 в 0:22

1 ответ 1

0

на контейнер добавь overflow: hidden;

1

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge you have read our privacy policy.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.