title: css text align center and background color
body: <p>hey guys was hoping you could help me out..</p>
  
  <p>The task seems simple but I just cant figure it out...</p>
  
  <p>i.e</p>
  
  <pre><code>&lt;div style="text-align: center;background-color: rgb(150, 161, 255);  " id="clock"&gt;
          asd
  &lt;/div&gt;
  </code></pre>
  
  <p>I have a div with some text in it, and I want to center align that text and make the background such that it stays only behind the text.</p>
  
  <p>doing display:inline makes the background stay only behind the text, but then the text is no longer center alligned.</p>
  
  <p>tried all display properties of css but no luck diddnt work.</p>
  
  <p>been googling for like 20 minutes now but I guess im not sure what to search for .</p>
  
  <p>any help would be appreciated.thanks.</p>