Set the width of the bootstrap panel to the width of the text

I am new to HTML / Boostrap, so maybe this is pretty simple. How do you set the width of the loading bar to the length of the text?

If this is not possible with the panel, is there a similar bootstrap component that anyone knows what I can use? The closest I've seen labels , but they are too small.

+4
source share
1 answer

Make the bootstrap panel more modest

Use the main panel example . We must set the property displayas the inline-blocktwo classes: .paneland .panel-body.

, CSS- id. :

@import url('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css');

#modest,
#modest .panel-body,
.panel-modest,
.panel-modest .panel-body {
  display: inline-block;
}
<div class="panel panel-default">
  <div class="panel-body">
    Basic panel example
  </div>
</div>

<div class="panel panel-default panel-modest">
  <div class="panel-body">
    Modest panel uses class
  </div>
</div>

<div id="modest" class="panel panel-default">
  <div class="panel-body">
    Modest panel uses id
  </div>
</div>
Hide result
+9

All Articles