2016-01-22 79 views
0

我正在嘗試重新創建this,並且似乎無法使價格排隊。我相信我應該嵌套列,但似乎無法弄清楚。它目前有this。提前致謝!自舉嵌套列

.special-1 { 
 
    color: black; 
 
    float: left; 
 
} 
 
.special-2 { 
 
    float: right; 
 
} 
 
.center { 
 
    text-align: center; 
 
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 
 
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" /> 
 

 
<div class="row special-1"> 
 
\t \t \t <div class="col-sm-8"> 
 
\t \t \t \t \t <h3 class="center">Lunch Special</h3> 
 
\t \t \t \t \t <p class="center">11:00am - 3:00pm<br>No Soup for Take Out Orders<br>Served with Pork Fried Rice, Spring Roll, Egg Flower Soup, or Hot Sour Soup</p> 
 
\t \t \t \t \t <div class="row"> 
 
\t \t \t \t \t \t <div class="col-sm-6"> 
 
\t \t \t \t \t \t \t <p>xxx $x.xx<br>xxx $x.xx<br>xxx $x.xx<br>xxx $x.xx</p> 
 
\t \t \t \t \t \t </div> 
 
\t \t \t \t \t \t <div class="col-sm-6"> 
 
\t \t \t \t \t \t \t <p>xxx $x.xx<br>xxx $x.xx<br>xxx $x.xx<br>xxx $x.xx</p> 
 
\t \t \t \t \t \t </div> 
 
\t \t \t \t \t </div> 
 
\t \t \t </div> 
 
\t \t </div> 
 
\t \t 
 
\t \t <div class="row special-2"> 
 
\t \t \t <div class="col-sm-8"> 
 
\t \t \t \t \t <h3 class="center">Dinner Special</h3> 
 
\t \t \t \t \t <p class="center">3:00pm - Closing<br>No Soup for Take Out Orders<br></p> 
 
\t \t \t \t \t <div class="row"> 
 
\t \t \t \t \t \t <div class="col-sm-6"> 
 
\t \t \t \t \t \t \t <p>xxx $x.xx<br>xxx $x.xx<br>xxx $x.xx<br>xxx $x.xx</p> 
 
\t \t \t \t \t \t </div> 
 
\t \t \t \t \t \t <div class="col-sm-6"> 
 
\t \t \t \t \t \t \t <p>xxx $x.xx<br>xxx $x.xx<br>xxx $x.xx<br>xxx $x.xx</p> 
 
\t \t \t \t \t \t </div> 
 
\t \t \t \t \t </div> 
 
\t \t \t </div> 
 
\t \t </div>

回答

0

您還沒有實際嵌套的任何東西。

當你需要這些一起工作時,你有行/列/行/列END行/列/行/列END,而不是完全分開。

查看FullPage的工作示例和Doc Nested Columns

.special { 
 
    background: lightblue; 
 
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" /> 
 
<div class="container special"> 
 
    <div class="row"> 
 
    <div class="col-sm-6"> 
 

 
     <h3 class="text-center">Lunch Special</h3> 
 
     <p class="text-center">11:00am - 3:00pm 
 
     <br>No Soup for Take Out Orders 
 
     <br>Served with Pork Fried Rice, Spring Roll, Egg Flower Soup, or Hot Sour Soup</p> 
 

 
     <div class="row"> 
 
     <div class="col-sm-6"> 
 
      <p>xxx $x.xx 
 
      <br>xxx $x.xx 
 
      <br>xxx $x.xx 
 
      <br>xxx $x.xx</p> 
 
     </div> 
 
     <div class="col-sm-6"> 
 
      <p>xxx $x.xx 
 
      <br>xxx $x.xx 
 
      <br>xxx $x.xx 
 
      <br>xxx $x.xx</p> 
 
     </div> 
 
     </div> 
 
    </div> 
 

 
    <div class="col-sm-6"> 
 
     <h3 class="text-center">Dinner Special</h3> 
 
     <p class="text-center">3:00pm - Closing 
 
     <br>No Soup for Take Out Orders 
 
     <br> 
 
     <br> 
 
     </p> 
 

 
     <div class="row"> 
 
     <div class="col-sm-6"> 
 
      <p>xxx $x.xx 
 
      <br>xxx $x.xx 
 
      <br>xxx $x.xx 
 
      <br>xxx $x.xx</p> 
 
     </div> 
 
     <div class="col-sm-6"> 
 
      <p>xxx $x.xx 
 
      <br>xxx $x.xx 
 
      <br>xxx $x.xx 
 
      <br>xxx $x.xx</p> 
 
     </div> 
 
     </div> 
 

 
    </div> 
 
    </div> 
 
</div>

+0

奇怪,當我運行它扔的StackOverflow它工作正常,但一旦我把它扔到我的代碼,它可以追溯到被豎放 –

+0

奇怪,我想到的第一件事情如果你的CSS有任何改變,改變了Bootstraps核心CSS,或者嘗試清除瀏覽器緩存。 – vanburen