2017-10-06 35 views
0

嘗試使用引導到內背景

<div class="container"> 
 
<div class="row"> 
 
<div class="col-lg-9"> 
 
    <h2 style="font-family:times-new-roman">BIOGRAPHY</h2> 
 
    <div id="demo" class="collapse"> 
 
    <p> 
 
Albert Einstein (14 March 1879 – 18 April 1955) was a German-born theoretical physicist.[5] Einstein developed the theory of relativity, one of the two pillars of modern physics (alongside quantum mechanics).[4][6]:274 Einstein's work is also known for its influence on the philosophy of science.[7][8] Einstein is best known by the general public for his mass–energy equivalence formula E = mc2 (which has been dubbed "the world's most famous equation"). 
 
</p> 
 
    </div> 
 
    <button type="button" class="btn btn-info" data-toggle="collapse" data-target="#demo" style="color: black; background-color: transparent; border: none; font-color:black"> 
 
    <br> 
 
    <div class="text-center"> 
 
    <i class="fa fa-angle-double-down" style="font-size:36px;"></i> 
 
    </div> 
 
    </button> 
 
</div> 
 
<div class="col-lg-3"> 
 
</div> 
 
</div> 
 
</div>

我想有一個網站,我創建這個部分容納文本。正如你所看到的,我使用Bootstrap網格系統來確保文本只在特定的框中。問題是文本仍然填充整個頁面,所以Bootstrap似乎不起作用。也許我沒有做正確的事情。

回答

0

你在頭文件中包含引導程序4和fontawesome css文件和jquery嗎?

內容僅顯示在自舉網格佈局中。見下文和fiddle我的代碼,並檢查引導CSS版本和js文件

<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/> 
 
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> 
 
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js"></script> 
 
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" rel="stylesheet"/> 
 
<div class="container"> 
 
<div class="row"> 
 
<div class="col-lg-9"> 
 
    <h2 style="font-family:times-new-roman">BIOGRAPHY</h2> 
 
    <div id="demo" class="collapse"> 
 
    <p> 
 
Albert Einstein (14 March 1879 – 18 April 1955) was a German-born theoretical physicist.[5] Einstein developed the theory of relativity, one of the two pillars of modern physics (alongside quantum mechanics).[4][6]:274 Einstein's work is also known for its influence on the philosophy of science.[7][8] Einstein is best known by the general public for his mass–energy equivalence formula E = mc2 (which has been dubbed "the world's most famous equation"). 
 
</p> 
 
    </div> 
 
    <button type="button" class="btn btn-info" data-toggle="collapse" data-target="#demo" style="color: black; background-color: transparent; border: none; font-color:black"> 
 
    
 
    <br> 
 
    <div class="text-center"> 
 
    <i class="fa fa-angle-double-down" style="font-size:36px;"></i> 
 
    </div> 
 
    </button> 
 
</div> 
 
<div class="col-lg-3"> 
 
</div> 
 
</div> 
 
</div>