title: how can we make a div take width according to its content automatically
body: <p>I want to create an effect like that of <code>fieldset</code> and <code>label</code>.</p>
  
  <p><img src="https://i.stack.imgur.com/1TMor.png" alt="alt text"></p>
  
  <p>When the headings change along the side, the width that the white background of the heading remains the same. </p>
  
  <p>If I can make the <code>heading</code> or <code>div</code> element to take the width enough to fit its content, it will give the proper effect. </p>
  
  <p>If there is any other solution please let me know.</p>