我不希望divs并排

时间:2018-01-02 22:50:24

标签: html css twitter-bootstrap

我不希望divs并排。我怎么能解决这个问题

搜索 - >假



<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/css/bootstrap.min.css" rel="stylesheet" />
<div class="row ">
  <div class="col-md-8 "></div>
  <div class="col-md-4 d-flex justify-content-start">
    <div class="search">
      <p>search</p>
    </div>
    <div class="about">
      <p>about</p>
    </div>
  </div>
</div>
&#13;
&#13;
&#13;

7 个答案:

答案 0 :(得分:0)

.search {border: 1px solid #000; display: block!important;}
.about {border: 1px solid #000; display: block!important;}
<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-md-8 ">
</div>

<div class="col-md-4">

      <div class="search">
        <p>search</p>
      </div>

      <div class="about">
        <p>about</p>
      </div>
</div>

</div>

在您的CSS div { display: block; }上,或者您可以为您的课程提供属性,例如:

.search { display: block;}
.about { display: block;}

如果您只想测试它是否有效,您可以直接在html上编写它,但只要看到它有效就将其更改为CSS文件:

<div style="display: block;" class="search">
    <p>search</p>
  </div>

  <div style="display: block;" class="about">
    <p>about</p>
  </div>

答案 1 :(得分:0)

您是否在div之间尝试了<br/>标记?

答案 2 :(得分:0)

从div

中删除class =“col-md-4”

答案 3 :(得分:0)

.search {border: 1px solid #000; display: block!important;}
.about {border: 1px solid #000; display: block!important;}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/css/bootstrap.min.css" rel="stylesheet"/>

<div class="container">
<div class="row ">

<div class="col-md-8 ">
</div>

<div class="col-md-4  d-flex justify-content-start">

      <div class="search">
        <p>search</p>
      </div>

      <div class="about">
        <p>about</p>
      </div>
</div>

</div>

答案 4 :(得分:0)

您可以尝试将此css样式添加到div元素:

div{
    clear:both;
}

答案 5 :(得分:0)

它在我的浏览器中完美运行。 import numpy as np from scipy import integrate import scipy.optimize import matplotlib.pyplot as plt xlist = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14] ylist = [1.0, 0.7028985507246377, 0.4782608695652174, 0.36231884057971014, 0.2536231884057971, 0.1811594202898551, 0.12318840579710147, 0.08695652173913046, 0.057971014492753645, 0.04347826086956524, 0.02173913043478263, 0.007246376811594223] xdata = np.array(xlist) ydata = np.array(ylist) parameter_initial = np.array([2.5,2.5,2.5]) # a, b, c def func(x,a,b,c): fn = lambda t : t**(a-1)*np.exp(-t) den = integrate.quad(fn, 0.0, b/c)[0] num = np.asarray([integrate.quad(fn, _x/c, b/c)[0] for _x in x]) return num/den parameter_optimal, cov = scipy.optimize.curve_fit(func, xdata, ydata,p0=parameter_initial) print("paramater =", parameter_optimal) y = func(xdata, *parameter_optimal) plt.plot(xdata, ydata, 'o') plt.plot(xdata, y, '-') plt.show() 标记默认为块元素。我认为你应该更新你的浏览器。

&#13;
&#13;
<div>
&#13;
&#13;
&#13;

答案 6 :(得分:0)

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/css/bootstrap.min.css" rel="stylesheet"/>

<div class="container">
<div class="row ">

<div class="col-md-8 ">
</div>

<div class="col-md-4 d-flex justify-content-start">

      <div class="search">
        <p>search</p>
      </div>

      <div class="about">
        <p>about</p>
      </div>
</div>

</div>

d-flex justify-content-start - 如果我添加此代码它不起作用