title: How can I align text next to a container and stop it from overlapping?
body: <p>I have a website that shows star ratings. Next to the stars, I would like to show the numerical score that accompanies the number of stars. However, the CSS properties that enable the stars to show correctly is causing the text that I would like to display to overlap with the stars on my page. To better illustrate the problem, I have included a code snippet.</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>body {
    display: grid;
    grid-template-areas:
      'header header header'
      'nav article ads'
      'nav footer footer';
    grid-template-rows: 80px 1fr 70px;
    grid-template-columns: 20% 1fr 15%;
    grid-row-gap: 1px;
    grid-column-gap: 1px;
    height: 100vh;
    margin: 0;
    padding: 0;
  }
  
  a {
    color: #0ad05b;
    text-decoration: none;
  }
  
  a:hover {
    color: #e3eaee;
  }
  
  header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.2em;
    background: #21313c;
    font-family: Helvetica, Arial, sans-serif;
    color: #e3eaee;
    font-size: 14px;
  }
  footer,
  article,
  nav,
  div {
    padding: 1.2em;
    background: #061621;
    font-family: Helvetica, Arial, sans-serif;
    color: #e3eaee;
    font-size: 14px;
  }
  textarea {
    font-family: Arial, Helvetica, sans-serif;
  }
  #pageHeader {
    grid-area: header;
  }
  #pageFooter {
    grid-area: footer;
  }
  #mainArticle {
    grid-area: article;
    align-content: flex-start;
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: flex-start;
  }
  #mainArticleShip {
    grid-area: article;
    align-content: flex-start;
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: flex-start;
  }
  #mainNav {
    grid-area: nav;
  }
  #siteAds {
    grid-area: ads;
  }
  /* Form Style */
  #mainArticleForm {
    background: linear-gradient(50deg, rgba(6, 22, 33, 0.5), rgb(0, 0, 0)),
      url(https://cruisecrunch.s3.us-east-2.amazonaws.com/bg.jpg);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: right;
  }
  #mainArticle {
    background: linear-gradient(15deg, rgba(6, 22, 33, 0.7), rgb(0, 0, 0)),
      url(https://cruisecrunch.s3.us-east-2.amazonaws.com/bg.jpg);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: right;
  }
  .innerArticleSignup {
    background: transparent;
  }
  .innerArticleForm {
    width: 65%;
    margin: 0 auto;
    background: transparent;
  }
  .text {
    background: transparent;
  }
  .reviewForm {
    background: transparent;
  }
  .innerArticleForm h1 {
    color: #e3eaee;
    text-align: center;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 30px;
  }
  .innerArticleForm h2 {
    color: #e3eaee;
    text-align: center;
    font-size: 18px;
  }
  form {
    padding: 39px;
  }
  .form__group {
    background: #000000a1;
    display: flex;
    justify-content: space-between;
  }
  .form__group label {
    width: 232px;
    display: inline;
    text-align: left;
  }
  .form__group select {
    padding: 6px;
    float: right;
  }
  .form__group input {
    padding: 6px;
    font-size: 14px;
    border-radius: 4px;
    float: right;
  }
  .form__group textarea {
    font-size: 14px;
    float: right;
    height: auto;
    width: 100%;
    color: #767676;
  }
  
  .primary {
    padding: 8px 18px;
    margin: 22px 0px;
    font-size: 18px;
    background: #0ad05b;
    border: 2px solid #989898;
  }
  .innerArticle {
    height: 17vh;
    width: 17vh;
    background: transparent;
    margin-top: 1rem;
    margin-bottom: 1rem;
  }
  .big-user-photo {
    border-radius: 50%;
  }
  .userAvatar {
    height: 3rem;
    width: 3rem;
    border-radius: 50%;
    margin-right: 1rem;
  }
  .mainPage {
    height: 3rem;
    width: 3rem;
    border-radius: 50%;
    margin-right: 1rem;
  }
  .headerRight {
    grid-area: header;
    justify-self: right;
    padding: 1.2em;
    background: #21313c;
    font-family: Helvetica, Arial, sans-serif;
    color: #e3eaee;
  }
  .right {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0.5em;
    background: #21313c;
    font-family: Helvetica, Arial, sans-serif;
    color: #e3eaee;
  }
  
  .left {
    background: #21313c;
    font-family: Helvetica, Arial, sans-serif;
    color: #e3eaee;
    align-content: left;
    align-items: left;
    justify-content: left;
  }
  
  .form-user-photo {
    height: 15rem;
    width: 15rem;
  }
  
  .alert {
    position: fixed;
    top: 0;
    left: 50%;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    z-index: 9999;
    color: #fff;
    font-size: 1.8rem;
    font-weight: 400;
    text-align: center;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
    padding: 1.6rem 15rem;
    -webkit-box-shadow: 0 2rem 4rem rgba(0, 0, 0, 0.25);
    box-shadow: 0 2rem 4rem rgba(0, 0, 0, 0.25);
  }
  .alert--success {
    background-color: #0ad05b;
  }
  .alert--error {
    background-color: #eb4d4b;
  }
  .stars-container {
    position: relative;
    display: inline-block;
    color: transparent;
  }
  
  .stars-container:before {
    position: absolute;
    top: 0;
    left: 0;
    content: '★★★★★';
    color: lightgray;
  }
  
  .stars-container:after {
    position: absolute;
    top: 0;
    left: 0;
    content: '★★★★★';
    color: gold;
    overflow: hidden;
  }
  
  .stars-0:after {
    width: 0%;
  }
  .stars-10:after {
    width: 10%;
  }
  .stars-20:after {
    width: 20%;
  }
  .stars-30:after {
    width: 30%;
  }
  .stars-40:after {
    width: 40%;
  }
  .stars-50:after {
    width: 50%;
  }
  .stars-60:after {
    width: 60%;
  }
  .stars-70:after {
    width: 70%;
  }
  .stars-80:after {
    width: 80%;
  }
  .stars-90:after {
    width: 90%;
  }
  .stars-100:after {
    width: 100;
  }
  
  .shipImage {
    width: 200px;
    height: auto;
    border-radius: 10%;
  }
  
  .logo {
    width: 100%;
    max-width: 175px;
    height: auto;
  }
  
  .otherShips {
    align-content: flex-start;
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    justify-content: flex-start;
  }
  /* Stack the layout on small devices/viewports. */
  @media all and (max-width: 575px) {
    body {
      grid-template-areas:
        'header'
        'article'
        'ads'
        'nav'
        'footer';
      grid-template-rows: 80px 1fr 70px 1fr 70px;
      grid-template-columns: 1fr;
    }
    .form__group {
      display: block;
    }
  }
  @media (max-width: 1250px) {
    .innerArticleForm,
    .reviewForm,
    form {
      padding: 0;
    }
    .innerArticleForm {
      width: 70%;
    }
  }
  @media (max-width: 557px) {
    .innerArticleForm {
      width: 100%;
    }
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;head&gt;
    &lt;meta charset="utf-8" /&gt;
    &lt;title&gt;CruiseCrunch | Symphony of the Seas Reviews&lt;/title&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&gt;
    &lt;link
      rel="shortcut icon"
      type="image/ico"
      href="https://cruisecrunch.s3.us-east-2.amazonaws.com/favicon.ico"
    /&gt;
    &lt;link
      rel="stylesheet"
      href="/style.css"
    /&gt;
    &lt;link rel="stylesheet" href="[FONT AWESOME LINK]" /&gt;
    &lt;meta
      property="og:title"
      content="CruiseCrunch | Cruise Research And Reviews"
    /&gt;
    &lt;meta property="og:type" content="website" /&gt;
    &lt;meta property="og:url" content="https://www.cruisecrunch.com" /&gt;
    &lt;meta property="og:image" itemprop="image" content="/img/thumbnail.jpg" /&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;header id="pageHeader"&gt;
      &lt;div class="left"&gt;
        &lt;a href="/"
          &gt;&lt;img
            class="logo"
            src="/logo.png"
        /&gt;&lt;/a&gt;
      &lt;/div&gt;
      &lt;div class="right"&gt;
        &lt;p&gt;&lt;a href="/signup"&gt;Sign up&lt;/a&gt; | &lt;a href="/login"&gt;Login&lt;/a&gt;&lt;/p&gt;
      &lt;/div&gt;
    &lt;/header&gt;
    &lt;article id="mainArticleReviews"&gt;
      &lt;div class="text"&gt;
        &lt;h2&gt;Symphony of the Seas Reviews&lt;/h2&gt;
        &lt;a href="/addreview"&gt;&lt;i class="fa fa-plus"&gt; &lt;/i&gt; Add Review&lt;br /&gt;&lt;br /&gt;&lt;/a
        &gt;The Symphony of the Seas has an average rating of 5. There are 2 ratings
        for this ship.&lt;br /&gt;&lt;br /&gt;
        &lt;span class="stars-container stars-50"&gt;
        ★★★★★
        &lt;/span&gt;5.0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img
          class="shipImage"
          src="/img/ships/symphonyoftheseas.jpg"
          alt="Symphony of the Seas"
        /&gt;
      &lt;/div&gt;
      &lt;br /&gt;
      &lt;div class="innerArticleR"&gt;
        &lt;b class="span"&gt;CruiseFan on October 18th, 2020:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;span
          &gt;Sail Date: February, 2018&lt;/span
        &gt;&lt;br /&gt;&lt;span
          &gt;Review: It was pretty great. The food was amazing, but everything was
          expensive.&lt;/span
        &gt;
      &lt;/div&gt;
      &lt;div class="innerArticleR"&gt;
        &lt;b class="span"&gt; Turtle McTurtleston on October 21st, 2020:&lt;/b
        &gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;Sail Date: January, 2019&lt;/span&gt;&lt;br /&gt;&lt;span
          &gt;Review: LOVED Symphony of the Seas and all it had to offer. The salad
          bar was fabulous but would love to see grubs. I love that this ship has
          many ways of socializing for turtles like me to come out of their shell.
          Definitely recommend.
        &lt;/span&gt;
      &lt;/div&gt;
      &lt;div class="text"&gt;
        &lt;h2&gt;Other Royal Caribbean International Ships&lt;/h2&gt;
        &lt;br /&gt;
      &lt;/div&gt;
      &lt;article id="mainArticleShip"&gt;
        &lt;div class="innerArticle"&gt;
          &lt;a href="/ship/allure-of-the-seas"
            &gt;&lt;img
              class="mainPage"
              src="/img/ships/allureoftheseas.jpg"
              alt="Allure of the Seas" /&gt;&lt;/a
          &gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="/ship/allure-of-the-seas"&gt;Allure of the Seas&lt;/a
          &gt;&lt;br /&gt;&lt;br /&gt;
        &lt;/div&gt;
        &lt;div class="innerArticle"&gt;
          &lt;a href="/ship/harmony-of-the-seas"
            &gt;&lt;img
              class="mainPage"
              src="/img/ships/harmonyoftheseas.jpg"
              alt="Harmony of the Seas" /&gt;&lt;/a
          &gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="/ship/harmony-of-the-seas"&gt;Harmony of the Seas&lt;/a
          &gt;&lt;br /&gt;&lt;br /&gt;
        &lt;/div&gt;
        &lt;div class="innerArticle"&gt;
          &lt;a href="/ship/independence-of-the-seas"
            &gt;&lt;img
              class="mainPage"
              src="/img/ships/independenceoftheseas.jpg"
              alt="Independence of the Seas" /&gt;&lt;/a
          &gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="/ship/independence-of-the-seas"
            &gt;Independence of the Seas&lt;/a
          &gt;&lt;br /&gt;&lt;br /&gt;
        &lt;/div&gt;
        &lt;div class="innerArticle"&gt;
          &lt;a href="/ship/liberty-of-the-seas"
            &gt;&lt;img
              class="mainPage"
              src="/img/ships/libertyoftheseas.jpg"
              alt="Liberty of the Seas" /&gt;&lt;/a
          &gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="/ship/liberty-of-the-seas"&gt;Liberty of the Seas&lt;/a
          &gt;&lt;br /&gt;&lt;br /&gt;
        &lt;/div&gt;
        &lt;div class="innerArticle"&gt;
          &lt;a href="/ship/oasis-of-the-seas"
            &gt;&lt;img
              class="mainPage"
              src="/img/ships/oasisoftheseas.jpg"
              alt="Oasis of the Seas" /&gt;&lt;/a
          &gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="/ship/oasis-of-the-seas"&gt;Oasis of the Seas&lt;/a
          &gt;&lt;br /&gt;&lt;br /&gt;
        &lt;/div&gt;
        &lt;div class="innerArticle"&gt;
          &lt;a href="/ship/spectrum-of-the-seas"
            &gt;&lt;img
              class="mainPage"
              src="/img/ships/spectrumoftheseas.jpg"
              alt="Spectrum of the Seas" /&gt;&lt;/a
          &gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="/ship/spectrum-of-the-seas"
            &gt;Spectrum of the Seas&lt;/a
          &gt;&lt;br /&gt;&lt;br /&gt;
        &lt;/div&gt;
      &lt;/article&gt;
    &lt;/article&gt;
    &lt;nav id="mainNav"&gt;
      Navigation
      &lt;div class="nav"&gt;
        &lt;div class="ul"&gt;
          &lt;div class="li"&gt;
            &lt;a href="/"&gt;&lt;i class="fa fa-ship"&gt;&lt;/i&gt; All Ships&lt;/a&gt;
          &lt;/div&gt;
          &lt;div class="li"&gt;
            &lt;a href="/addreview"&gt;&lt;i class="fa fa-plus"&gt;&lt;/i&gt; Add Review&lt;/a&gt;
          &lt;/div&gt;
          &lt;div class="li"&gt;
            &lt;a href="/topships"&gt;&lt;i class="fa fa-trophy"&gt;&lt;/i&gt; Top Rated Ships&lt;/a&gt;
          &lt;/div&gt;
          &lt;div class="li"&gt;
            &lt;a href="/bestforkids"&gt;&lt;i class="fa fa-child"&gt;&lt;/i&gt; Best For Kids&lt;/a&gt;
          &lt;/div&gt;
          &lt;div class="li"&gt;
            &lt;a href="/bestvalue"&gt;&lt;i class="fa fa-dollar"&gt;&lt;/i&gt; Best Value&lt;/a&gt;
          &lt;/div&gt;
          &lt;div class="li"&gt;
            &lt;a href="/cabins"&gt;&lt;i class="fa fa-bed"&gt;&lt;/i&gt; Best Cabins&lt;/a&gt;
          &lt;/div&gt;
          &lt;div class="li"&gt;
            &lt;a href="/bestdining"&gt;&lt;i class="fa fa-beer"&gt;&lt;/i&gt; Best Dining&lt;/a&gt;
          &lt;/div&gt;
          &lt;div class="li"&gt;
            &lt;a href="/entertainment"
              &gt;&lt;i class="fa fa-film"&gt;&lt;/i&gt; Best Entertainment&lt;/a
            &gt;
          &lt;/div&gt;
          &lt;div class="li"&gt;
            &lt;a href="/worstships"
              &gt;&lt;i class="fa fa-thumbs-down"&gt;&lt;/i&gt; Lowest Rated Ships&lt;/a
            &gt;
          &lt;/div&gt;
          &lt;div class="li"&gt;
            &lt;a href="/recentreviews"
              &gt;&lt;i class="fa fa-rss-square"&gt;&lt;/i&gt; Most Recent Reviews&lt;/a
            &gt;
          &lt;/div&gt;
          &lt;div class="li"&gt;
            &lt;a href="/newships"&gt;&lt;i class="fa fa-anchor"&gt;&lt;/i&gt; New Ships&lt;/a&gt;
          &lt;/div&gt;
          &lt;div class="li"&gt;&lt;br /&gt;&lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/nav&gt;
    &lt;div id="siteAds"&gt;Over 6 cruise ship reviews!&lt;/div&gt;
    &lt;footer id="pageFooter"&gt;
      &lt;p class="footer"&gt;&amp;#169; 2020, CruiseCrunch&lt;/p&gt;
    &lt;/footer&gt;
  &lt;/body&gt;</code></pre>
  </div>
  </div>
  </p>