如何使文本从左向右流动 bootstrap

How to make text flow from left right bootstrap

我试图获得的效果是文本使用 bootstrap 中的列从左向右流动的位置。在第一个部分的第十二列之后,我想换行希望代码能让它更清晰。

<?php

?>

<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<script type="text/javascript" src="jquery.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<link rel="stylesheet" href="file.css"/>
</head>
<body>
        <div class="navbar navbar-default">
            <div class="container">

            <div class="navbar-header">
            <button class="navbar-toggle" data-toggle="collapse" data-target=".navCollapse">f</button>
                <a href="#" class="navbar-brand">
                    FLINTATION LOGO
                </div>



                <div class="collapse navbar-collapse navCollapse">
                    <ul class="nav navbar-nav navvbar-right">
                        <li><a href="#">Home</a></li>
                        <li><a href="#">Home</a></li>
                        <li><a href="#">Home</a></li>
                        <li><a href="#">Home</a></li>
                        <li><a href="#">Home</a></li>
                    </ul>
                </div>
            </div>
        </div>

        <div class="container">
            <div class="col-sm-8">
            "But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain wa
            s born and I will give you a complete account of the system, and expound the actual teachings of th
            e great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or 
            avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue 
            or pursues or desires to obtain pain of itself, because it is pain, but because occas
            ionally circumstances occur in which toil and pain can procure him some great pleasure. To take 
            a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some ad
            vantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has n
            o annoying consequences, or one who avoids a pain that produces no resultant pleasure?"
            </div>

            <div class="col-sm-4">
                <img src="images/amber.png"/>
            <div><br>

            <div id="left">
                <div>
                    But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain wa
                s born and I will give you a complete account of the system, and expound the actual teachings of th
                e great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or 
                avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue 
                </div>
            </div>

</body>

After the amber.png file on the page I want the next div to appear onto a new line starting from the left, instead of right.

希望大家能理解,有问题尽管问!

谢谢杰弗里。

您需要使用正确的结构,包括 Bootstrap .row 和列

一般结构是

<div class="container">
  <div class="row">
      <div class="col-sm-8">
      </div>

      <div class="col-sm-4">
      <img/>
      </div>

      <div id="left" class="col-sm-12"> /* or whatever width */
      </div>
      </div>

  </div>

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
  <div class="row">
    <div class="col-sm-8">
      "But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain wa s born and I will give you a complete account of the system, and expound the actual teachings of th e great explorer of the truth, the master-builder of
      human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue or pursues or desires to obtain pain of itself, because it is pain, but because occas ionally circumstances
      occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some ad vantage from it? But who has any right to find fault with a man who chooses
      to enjoy a pleasure that has n o annoying consequences, or one who avoids a pain that produces no resultant pleasure?"
    </div>

    <div class="col-sm-4">
      <img src="http://lorempixel.com/image_output/food-q-c-200-200-1.jpg" />
    </div>

    <div id="left" class="col-sm-12">
      But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain wa s born and I will give you a complete account of the system, and expound the actual teachings of th e great explorer of the truth, the master-builder of human
      happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue
    </div>
  </div>

</div>

Codepen Demo

您需要将它们排成行。请参阅示例 jsfiddle

<div class="container">
    <div class="row">
        <div class="col-sm-8"></div>
        <div class="col-sm-4">
           <img src="images/amber.png"/>here
        </div>
    </div>
    <div class="row">
        <div class="col-sm-12" id="left">
                <div>
                    test
                </div>
         </div>
    </div>
</div>

https://jsfiddle.net/xp2d4wqz/

尝试使用 bootstrap class row 来分隔各个部分。这是工作 fiddle https://jsfiddle.net/xp2d4wqz/1/