user6035846
user6035846

Reputation:

Twitter Bootstrap Text in Div extends beyond its column

I created a test html page using Twitter Bootstrap 4 Alpha 2. As shown below I have three divs with col-md-4 each. The first div has text wrapped in p. The problem is the text extends beyond it's container occupying the space of the other 2 divs. How do you keep the text in its own column?

<!doctype html>
<html class="no-js" lang="en">
  <head>
    <meta charset="utf-8" />
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Bootstrap Template</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" />

    <style>
        div {
            border-style: solid;
            border-color: #0000ff;
        }
      </style>
  </head>
  <body>
    <div class="container">

        <div class="row">

            <div class="col-md-4"><p>Box 1 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p></div>

            <div class="col-md-4"><p>Box 2</p></div>
            <div class="col-md-4"><p>Box 3</p></div>

        </div>

    </div>

    <script src="bower_components/jquery/dist/jquery.mi1n.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/js/bootstrap.min.js"></script>


  </body>
</html>

Upvotes: 1

Views: 1701

Answers (2)

Cherish
Cherish

Reputation: 312

This is 100% work for you:

p{word-break: break-all;}

Upvotes: 1

Nick Bullatovci
Nick Bullatovci

Reputation: 365

Just Add 'overflow:auto;' to your Style code.

       border-style: solid;
       border-color: #0000ff;
       overflow:auto;       

Upvotes: 0

Related Questions