<code>
包裹,可是須要用<和>表示尖括號。<kbd>
包裹表示鍵盤輸入的內容。<pre>
包裹多行代碼,一樣須要對尖括號作轉義處理。可使用 .pre-scrollable 類,其做用是固定代碼框大小設置 max-height 爲 350px ,並在垂直方向展現滾動條<var>
表示變量<smp>
表示程序輸出<table> <thead> <tr> <th>一</th> <th>二</th> <th>三</th> <th>四</th> </tr> </thead> <tbody> <tr > <td>內容一</td> <td>內容二</td> <td>內容三</td> <td>內容四</td> </tr> <tr> <td>內容一</td> <td>內容二</td> <td>內容三</td> <td>內容四</td> </tr> </tbody> </table>
一 | 二 | 三 | 四 |
---|---|---|---|
內容一 | 內容二 | 內容三 | 內容四 |
內容一 | 內容二 | 內容三 | 內容四 |
基本表格樣式:css
class="table"
表示表格,賦予基本的樣式 — 少許的內補(padding)和水平方向的分隔線.table-striped
類能夠給 表格體以內的每一行增長斑馬條紋樣式 .table-bordered
類爲表格和其中的每一個單元格增長邊框.table-hover
類可讓每一行對鼠標懸停狀態做出高亮響應.table-condensed
類可讓表格更加緊湊,單元格中的內補(padding)均會減半特殊狀態:html
<form> <div class="form-group"> <label for="exampleInputEmail1">Email address</label> <input type="email" class="form-control" id="exampleInputEmail1" placeholder="Email"> </div> <div class="form-group"> <label for="exampleInputPassword1">Password</label> <input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password"> </div> <div class="form-group"> <label for="exampleInputFile">File input</label> <input type="file" id="exampleInputFile"> <p class="help-block">Example block-level help text here.</p> </div> <div class="checkbox"> <label> <input type="checkbox"> Check me out </label> </div> <button type="submit" class="btn btn-default">Submit</button> </form>
注意:
1 全部設置了 .form-control 類的輸入框,文本框 和多選框 元素都將被默認設置寬度屬性爲 width: 100%;。 將 label 元素和前面提到的控件包裹在 .form-group 中能夠得到最好的排列。
2 爲了可讀性和更好的添加各類類屬性,儘可能將每個表單控件都單獨放在一個div中。
3 爲每個input輸入框都要添加label標籤,這是爲了屏幕閱讀器識別表單。即便不想顯示label元素,也可以使用.sr-only 類將其隱藏。
4 作內聯表單,並未input輸入框添加圖標的時候,須要將span和input標籤維持在一個div中,併爲div添加input-group類
5 多選框組的每個多選框都要包裹在一個div中,而且在div添加類checkbox或者radio表示,單選則標籤的name須要保持一致
6 反饋圖標只能做用在具備form-control的input框上,而且須要在div包裹的內聯span和input以外,不然會亂版
正確示例git
<div class="form-group has-success has-feedback"> <label class="control-label" for="inputGroupSuccess1">Input group with success</label> <div class="input-group"> <span class="input-group-addon">@</span> <input type="text" class="form-control" id="inputGroupSuccess1" aria-describedby="inputGroupSuccess1Status"> </div> <span class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true"></span> <span id="inputGroupSuccess1Status" class="sr-only">(success)</span> </div>
通常可用按鈕的元素bootstrap
<a class="btn btn-default" href="#" role="button">Link</a> <button class="btn btn-default" type="submit">Button</button> <input class="btn btn-default" type="button" value="Input"> <input class="btn btn-default" type="submit" value="Submit">
對於a,做爲按鈕添加了role="button",此時已徹底失去了連接的做用,而在導航的時候,只能使用button做爲按鈕,因此最好使用button用做按鈕api
簡單的登錄頁面樣式ide
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>login</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="./css/bootstrap.css"> <style> body{ padding:0; margin:0; } #bg{width:100%;height:100%;position:absolute;z-index:-1;opacity: 0.8} #login{position:absolute;left:22.5%;top:40%;margin-left:-150px;margin-top:-100px; } </style> </head> <body> <div class="container" id="login"> <div class="row"> <div class="text-center"><h3> Please Login</h3></div> </div> <div class="row table-bordered"> <div class="col-md-6"> <h3 class="text-center text-capitalize"> my blog </h3> <p>記錄點滴,記錄成長,Adobe LiveCycle Document Security Server提供了在PDF表單和文檔中支持的文檔加密和數字簽名服務。Adobe LiveCycle Document Security Server provides services for document encryption and digital signature support on PDF forms and documents</p> <blockquote class="blockquote-reverse"> <p>stay hungry stay foolish<cite title="lincoln">————Ahrabam Lincoln</cite></p> </blockquote> </div> <div class="col-md-6"> <br> <form role="form" class=" form-horizontal"> <div class="form-group has-feedback"> <label for="Email" class="control-label col-md-2">Email:</label> <div class="col-md-10"> <div class="input-group"> <span class="input-group-addon" style="BACKGROUND-COLOR: transparent;">@</span> <input type="email" class="form-control" id="Email" placeholder="Email" style="BACKGROUND-COLOR: transparent;" aria-describedby="EmailHelp" autofocus required> </div> <span class="glyphicon glyphicon-ok form-control-feedback"></span> <span class="help-block sr-only" id="EmailHelp">Correct Email</span> </div> </div> <div class="form-group has-feedback"> <label for="password4" class="control-label col-md-2">Password:</label> <div class="col-md-10"> <div class="input-group"> <span class="input-group-addon" style="BACKGROUND-COLOR: transparent;"> = </span> <input type="password" class="form-control" id="password4" style="BACKGROUND-COLOR: transparent;" placeholder="Password"> </div> <span class="glyphicon glyphicon-remove form-control-feedback" aria-hidden="true"></span> </div> </div> <div class="col-md-offset-2"> <label class="radio-inline"> <input type="radio" name="role" value="student" checked> 學生 </label> <label class="radio-inline"> <input type="radio" name="role" value="teacher"> 老師 </label> <label class="radio-inline"> <input type="radio" name="role" value="admin" disabled> 管理員 </label> <br> <br> <div class="form-inline"> <button class="btn btn-primary" style="BACKGROUND-COLOR: transparent;">登陸入口</button> <button class="btn btn-primary" style="BACKGROUND-COLOR: transparent;" disabled>登陸入口2</button> <button class="btn btn-link">註冊</button> </div> </div> </form> </div> </div> </div> <img id="bg" src="./img/1.jpg" alt="..." class="img-rounded img-responsive"> </body> </html>