使用Bootstrap

使用Bootstrap

1.開啟一個新的資料夾,裡面建立css資料夾,以及外面建立index.html

2.到bootstrap官網下載,之後加css資料夾內的bootstrap.css放入你的css資料夾內

index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel='stylesheet' type='text/css' href='./css/bootstrap.css' />
    <title>Document</title>
</head>
<body>

</body>
</html>

或直接放入

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Bootstrap  Template</title>


    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>

  </head>
  <body>
   <div class="container">







</div>
 </body>
</html>

開始使用

1.everything inside container,所有的元素都必須放在這裡面

2.用class定義元素樣式

3.加起來等於12

4.Glyphicons

將下面放入container內

佈局

後面的數字加起來最大12,超過會跑到第二列

如果一個螢幕大小為1200px而div中具有xs和sm則sm會蓋過xs的效果

使用offset讓元素往右

等於

使用pull和push的absolute移動

push往左,pull往右

文字對齊

blockquote

比原生html多了左邊的直線 http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_blockquote_default_css

表單

導覽列

使用圖案,到https://kkbruce.tw/bs3/Components查詢

實際範例

加入導覽列

加入中間部分

2.

3.

4.

Last updated

Was this helpful?