如何从左侧右侧引导程序生成文本

时间:2016-03-29 20:14:05

标签: jquery html css twitter-bootstrap col

我试图获得的效果是文本将在引导程序中使用colunms从左向右流动。在第一个sectin的第12个colunm之后,我想打破一个新的行,希望代码能让它更清晰。

<?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>

  

在页面上的amber.png文件之后,我希望下一个div显示在从左边开始的新行上,而不是右边。

希望这可以理解,任何问题都可以问!

谢谢Jeffrey。

3 个答案:

答案 0 :(得分:0)

您需要使用适当的结构,包括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>

&#13;
&#13;
<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>
&#13;
&#13;
&#13;

Codepen Demo

答案 1 :(得分:0)

您需要将它们放入行中。请参阅示例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/

答案 2 :(得分:0)

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

相关问题