title: How to make border as big as text in it
body: <p>So it looks like this:<a href="https://i.stack.imgur.com/RkMqI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RkMqI.png" alt="enter image description here"></a></p>
  
  <p>this is the example code of a message:</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>.allMsg {
    width: 100%;
  }
  
  .self {
    border-radius: 1rem;
    background-color: #28a745;
    text-align: right;
    padding-left: 5px;
    padding-right: 5px;
    margin-left: 5px;
    margin-right: 5px;
  }
  
  .friend {
    text-align: left;
  }
  
  #chatWith {
    text-align: center;
    font-family: sans-serif;
    font-size: 40px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class='allMsg'&gt;
    &lt;p class='self chatMsg'&gt;Hello&lt;/p&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>How can i make the border as big as the text inside ... I thought the padding was going to work but unfortunately it didn't so please help me.</p>