2016-09-28 49 views
1

我有一個小框放在頁面的底部。我試圖在div上面放置一個表單,但表單不斷跳入引導程序div。試圖放置一個窗體頂部的div

這是HTML嘗試 EDITTED: 我也想在窗體該行有一個背景顏色thesame與麪包屑,但它沒有顯示

<div style="padding:1px; background-color: #F2F2F2;"> 
    <form class="rightiest" method="post" action="/logout"> 
      <input class="btn btn-link" type="submit" value="Leave Group"/> 
    </form> 
</div> 
<div class="breadcrumb"> 
      <div class="wrap"> 
       <div class="container" style="text-align: center;font-size: 80%;"> 
       <strong> Please hold we will soon attend to you shortly</strong> 



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

這是CSS控制形式

form.rightiest {float:right; margin-top:0px; margin-bottom:7px;} 

與上面一樣,窗體保持重疊到div中。請如何將表單放置在div上方。

回答

1

清除浮子。

 form.rightiest {float:right; 
 
     margin-top:0px; 
 
     margin-bottom:7px;} 
 
    
 
    .breadcrumb { 
 
     clear: both; 
 
    }
<form class="rightiest" method="post" action="/logout"> 
 
      <input class="btn btn-link" type="submit" value="Leave Chat"/> 
 
    </form> 
 
    <div class="breadcrumb"> 
 
       <div class="wrap"> 
 
        <div class="container" style="text-align: center;font-size: 80%;"> 
 
        <strong> Please hold we will soon attend to you shortly</strong> 
 
    
 
    
 
    
 
        </div> 
 
       </div> 
 
    </div>

+0

我正在應用背景顏色,但沒有顯示 – user6731422

+0
+0

您可以編輯您的問題以顯示BG顏色,請@ user6731422 –

2

您需要清除浮標。

.breadcrumb { 
    clear: both; 
} 
+0

是的,你需要改變你的表格的底部邊緣,並可能填充表單上了。如果您的麪包屑上有頂部填充或頂部邊距,可能還需要更改。 – Jrod