title: How to make text fit inside a box? html/css
body: <p>I have the following code:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>@import url('https://fonts.googleapis.com/css?family=Merriweather|Open+Sans');
  .square {
    max-width: 460px;
    background: white;
    border-radius: 4px;
    box-shadow: 0px 5px 20px #D9DBDF;
    -webkit-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
  }
  
  .square:hover {
    -webkit-transform: translate(20px, -10px);
    -ms-transform: translate(10px, -10px);
    transform: translate(10px, -10px);
    -webkit-box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  }
  
  .square .square-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    border: 5px solid #555;
  }
  
  .square .square-details {
    padding: 20px 30px 30px;
  }
  
  .h11 {
    margin: auto;
    text-align: left;
    font-family: 'Merriweather', serif;
    font-size: 24px;
  }
  
  p0 {
    text-align: justify;
    font-family: 'Open Sans', sans-serif;
    font-size: 12px;
    color: #C8C8C8;
    line-height: 18px;
    margin-top: 10px;
    display: block;
  }
  
  .button56 {
    background-color: #0563bb;
    color: white;
    width: 100px;
    padding: 10px 18px;
    border-radius: 3px;
    text-align: center;
    text-decoration: none;
    display: block;
    font-size: 12px;
    margin-top: 18px;
    margin-bottom: 0;
    cursor: pointer;
    font-family: 'merriweather';
  }
  
  .button56:hover {
    opacity: 0.9;
    color: white;
  }
  
  .square1:hover {
    -webkit-transform: translate(20px, -10px);
    -ms-transform: translate(10px, -10px);
    transform: translate(10px, -10px);
    -webkit-box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  }
  
  .square1 .square-image1 img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    border: 5px solid #555;
  }
  
  .square1 .square-details1 {
    padding: 20px 30px 30px;
  }
  
  .square1 {
    max-width: 460px;
    background: white;
    border-radius: 4px;
    box-shadow: 0px 5px 20px #D9DBDF;
    -webkit-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
  }
  
  @media screen and (max-width: 480px) {
    .square1 {
      margin-bottom: 0;
      margin-right: 0;
      margin-left: 0;
      margin-top: 54px;
      padding-left: 0;
      padding-right: 0;
    }
  }
  
  @media screen and (max-width: 480px) {
    .square1 .square-image1 img {
      height: 230px !important;
      border: 5px solid #555;
      padding-left: 0;
      padding-right: 0;
    }
    .square .square-image img {
      height: 230px !important;
      border: 5px solid #555;
      padding-left: 0;
      padding-right: 0;
    }
    .square,
    .square1 {
      max-width: 460px;
      width: 100%;
    }
    .h11 {
      width: 100% !important;
    }
  }
  
  .containerE {
    --bs-gutter-x: 1.5rem;
    width: 100%;
    padding-right: calc(var(--bs-gutter-x) / 2);
    padding-left: calc(var(--bs-gutter-x) / 2);
    margin-right: auto;
    margin-left: auto;
  }
  
  @media screen and (max-width: 480px) {
    .containerE {
      display: flex;
      flex-wrap: wrap;
      padding: 20px;
      justify-content: center;
      overflow: hidden;
    }
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;section&gt;
    &lt;div class="section-title"&gt;
      &lt;h2&gt;Featured Blogs Of The Day&lt;/h2&gt;
    &lt;/div&gt;
    &lt;div class="container" style="display: flex; justify-content: space-between;"&gt;
      &lt;div class="containerE" style="display: flex; justify-content: space-between;"&gt;
        &lt;div class="square"&gt;
          &lt;div class="square-image"&gt;
            &lt;img src="assets/img/Blog1.png"&gt;
          &lt;/div&gt;
  
          &lt;div class="square-details"&gt;
            &lt;h3 class="h11"&gt;“Chances Of My Uni/College Admission?”&lt;/h3&gt;
            &lt;p0&gt;It is that time of the year again (yay!) where we — high school students — are supposed to fill out the applications and land in our dream Universities/Colleges!&lt;/p0&gt;
            &lt;div&gt;&lt;a href="https://m-hussainomer03.medium.com/chances-of-my-uni-college-admission-20bc0efec0af" target="_" class="button56"&gt;Read More&lt;/a&gt;&lt;/div&gt;
          &lt;/div&gt;
  
        &lt;/div&gt;
        &lt;div class="square1"&gt;
          &lt;div class="square-image1"&gt;
            &lt;img src="assets/img/Blog2.png"&gt;
          &lt;/div&gt;
  
          &lt;div class="square-details1"&gt;
            &lt;h3 class="h11"&gt;My Career Advice To You: Take These Steps...&lt;/h3&gt;
            &lt;p0&gt;Humans tend to make mistakes — and its completely normal as it results in the growth and development of an individual — either psychologically or physically.&lt;/p0&gt;
            &lt;div&gt;&lt;a href="https://m-hussainomer03.medium.com/my-career-advice-to-you-take-these-steps-to-ultimate-prosperity-6c0687ce9c9f" target="_" class="button56"&gt;Read More&lt;/a&gt;&lt;/div&gt;
          &lt;/div&gt;
  
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/section&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>When you run the above code, open it on a new page, inspect it and view it on a 220 width screen, then you can see the text overflows outside the blog card.</p>
  <p>I want to make the <code>.h11</code> and <code>p0</code> text to fit inside the blog card and not flow outside of it. I dont want to change the font size of both of them, but is there a way I can set the width to 100% so that the text doesn't overflow outside the blog card?</p>
  <p>For some reason, the second blog card text is fine even on 220 width screen, but the first blog text is not. Any suggestions to make the <code>.h11</code> and <code>p0</code> text fit inside the blog card like the second blog card?</p>
  <p>I even tried adding a media query and using <code>width: 100%</code> to <code>.h11</code> but it did not work.</p>
  <p>It also seems like when I set screen width size to 150px, then even the second blog's text flows outside the card. Is there a way to fix this?</p>