VSO VSO - 2 months ago 7
CSS Question

Bootstrap Column is not expanding vertically

<body>
<div class="container">
<div class="row">
<div class="col-xs-12" style="background-color:red;">
dfsasfssssssssssssssssssssssssssssssssssssssssssssss
</div>
</div>
</div>
</body>


PLUNK to edit

This is probably something very obvious, but I thought bootstrap columns expanded vertically with content. Mine do not.

Bonus question: Was it always default behavior for bootstrap to indent "container" - how do I avoid this?

Answer

That's bootstrap normal behavior, because col-*-* is set float:left, so you need to use word-wrap:break-word, because you don't have spaces in your text.

To avoid the indent you mentioned (the default padding that bootstrap add to .container), you can reset by set .container {padding:0}

.col-xs-12 {
  background:red; /* demo */
  word-wrap: break-word
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
  <div class="row">
    <div class="col-xs-12">
      dfsasfssssssssssssssssssssssssssssssssssssssssssssssdfsasfssssssssssssssssssssssssssssssssssssssssssssssdfsasfssssssssssssssssssssssssssssssssssssssssssssssdfsasfssssssssssssssssssssssssssssssssssssssssssssssdfsasfssssssssssssssssssssssssssssssssssssssssssssssdfsasfssssssssssssssssssssssssssssssssssssssssssssssdfsasfssssssssssssssssssssssssssssssssssssssssssssssdfsasfssssssssssssssssssssssssssssssssssssssssssssssdfsasfssssssssssssssssssssssssssssssssssssssssssssssdfsasfssssssssssssssssssssssssssssssssssssssssssssssdfsasfssssssssssssssssssssssssssssssssssssssssssssss
    </div>
  </div>
</div>

Comments