二、課程內容
三、網站實例
四、課程規劃
改變文字大小:「設定/字型」「ctrl + =」增大 「ctrl + -」減少 分割視窗:「檢視/佈局」 切換全螢幕:「F11」 切換側邊欄:「檢視/側邊欄」 加入專案資料夾:直接拖曳資料夾至左側或「檔案/資料夾」 開關左側「專案資料夾」: ctrl+k , ctrl+b 請注意順序
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> </body> </html>
<IMG>和<img>
一樣,但建議採用小寫。CSS 套用方式
行內套用 (Inline)
嵌入套用 (Embed)
外部連接套用 (External Link)
匯入套用 (Import)
<b>粗體</b> <big>大號字</big> <em>著重文字</em> <i>斜體字</i> <small>小號字</small> <strong>加重語氣</strong> <sub>下標字</sub> <sup>上標字</sup> <ins>插入字</ins> <del>刪除字</del>
1.無序列表
2.有序列表
3.嵌套列表
4.自定義列表
5.行內套用 (Inline)
<h2 style=color:blue;font-family:"標楷體">......</h2>
6.嵌入套用 (Embed)
<style type="text/css"> h2 {color:blue} </style>
7.外部連接套用 (External Link)
<link rel=stylesheet type="text/css" href="../main.css">
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>無序列表3-1</title> </head> <body> <ul> <li>蘋果</li> <li>香蕉</li> <li>橘子</li> <li>水蜜桃</li> </ul> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>有序列表3-2</title> </head> <body> <ol> <li>蘋果</li> <li>香蕉</li> <li>橘子</li> <li>水蜜桃</li> </ol> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>嵌套列表3-3</title> </head> <body> <ul> <li>高中</li> <ul> <li>台南一中</li> <li>台南女中</li> <li>台南二中</li> </ul> <li>國中</li> <ul> <li>新興國中</li> <li>建興國中</li> <li>中山國中</li> </ul> <li>國小</li> <ul> <li>新興國小</li> <li>日新國小</li> <li>安平國小</li> </ul> </ul> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>自定義列表3-4</title> </head> <body> <dl> <dt>咖啡</dt> <dd>黑色的飲料</dd> <dt>牛奶</dt> <dd>白色的飲料</dd> </dl> </body> </html>
有序列表的屬性
https://webugm.github.io/tncomu10601/3-5.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>有序列表的屬性3-5</title> </head> <body> <ol type="A"> <li>蘋果</li> <li>香蕉</li> <li>橘子</li> <li>水蜜桃</li> </ol> <ol type="a"> <li>蘋果</li> <li>香蕉</li> <li>橘子</li> <li>水蜜桃</li> </ol> <ol type="I"> <li>蘋果</li> <li>香蕉</li> <li>橘子</li> <li>水蜜桃</li> </ol> <ol type="i"> <li>蘋果</li> <li>香蕉</li> <li>橘子</li> <li>水蜜桃</li> </ol> <ol start="6"> <li>蘋果</li> <li>香蕉</li> <li>橘子</li> <li>水蜜桃</li> </ol> </body> </html>
無序列表的屬性
https://webugm.github.io/tncomu10601/3-6.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>無序列表</title> </head> <body> <ul type="disc"> <li>蘋果</li> <li>香蕉</li> <li>橘子</li> <li>水蜜桃</li> </ul> <ul type="circle"> <li>蘋果</li> <li>香蕉</li> <li>橘子</li> <li>水蜜桃</li> </ul> <ul type="square"> <li>蘋果</li> <li>香蕉</li> <li>橘子</li> <li>水蜜桃</li> </ul> </body> </html>
本單元通過講解HTML區塊元素、行內元素等,掌握HTML區塊元素,並認識HTML5區塊元素。
本單元講解HTML樣式,包含基本標籤、屬性、三種樣式表插入方法(外部樣式表、內部樣式表、內聯樣式表)
<link rel="stylesheet" type="text/css" href="css/style.css" />
<style type="text/css"> hr {color: sienna;} p {margin-left: 20px;} body {background-image: url("images/back40.gif");} </style>
<p style="color: sienna; margin-left: 20px"> 這是行內樣式表 </p>
二、設定Git
git config --global user.name "tawan158" git config --global user.email "tawan158@ugm.com.tw"
git config --global user.name "tawan158"
git config --global user.email "tawan158@ugm.com.tw"
請輸入自己申請的Github帳號與email
在每一次的 Git commit (提交,我們稍後會提到) 都會記錄作者的訊息像是 name 及 email ,
--global 代表全域設定,所有的數據庫
由於電腦教室會還原,因此每次到教室安裝「git」後,記得都要設定
git config --list
git config --global color.ui true
三、Windows 提示字元操作
四、Git操作(這裡僅介紹與上傳有關的指令)
一、建立網頁檔案,上傳至github
<h1>~<h6>標題 <p>段落</p> <div>區域</div> <pre>程式碼</pre> <ol>有序清單</ol><ul>無序清單</ul> <table></table> -------------------------------------------------- <a>連結</a> <br />換行 <img />圖片 <span>區域</span>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>練習5-1</title> </head> <body> <h1>練習5-1</h1> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>練習5-2</title> </head> <body> <h1>練習5-2</h1> <h2>練習5-2</h2> <h3>練習5-2</h3> <h4>練習5-2</h4> <h5>練習5-2</h5> <h6>練習5-2</h6> 練習5-2 <p>練習5-2</p> <div>練習5-2</div><div>練習5-2</div> <span>練習5-2</span><span>練習5-2</span> </body> </html>
5-3.html :請自行至 tw.yahoo.com 複制一段標題與段落
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>練習5-3</title> </head> <body> <h1>MLB/為了這一分 他受盡了苦難</h1> <p>紅雀隊今天以1比2輸給小熊隊,不過紅雀隊攻下的唯一1分,可是Stephen Piscotty歷經各種苦難之後拿下來的。</p> <p>紅雀隊今天遭到小熊隊強投Jake Arrieta的全力封鎖,打擊無法發揮。5局下Piscotty被Arrieta投出的球擊中右手肘上一壘,接著Arrieta暴投,Piscotty衝上二壘時,又被捕手Willson Contreras的傳球打到另一隻手的手肘。</p> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>首頁</title> </head> <body> <h1>首頁</h1> <ul> <li><a href="5-1.html">練習5-1</a></li> <li><a href="5-2.html">練習5-2</a></li> <li><a href="5-3.html" target="_blank">練習5-3</a></li> </ul> </body> </html>
5-4.html :練習插入圖片,請先將上面圖片下載至專案 img/ex5.png
這裡需了解「圖片放置位置」「網頁檔案位置」之間的關係
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>練習5-4</title> </head> <body> <h1>插入圖片</h1> <div><img src="img/ex5.png"></div> </body> </html>
三、CSS盒子模式
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <link rel="stylesheet" type="text/css" href="css/style.css"> <title>練習5-5</title> </head> <body> <h1>padding</h1> <table border=1> <tr> <td>內邊距</td> </tr> </table> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <link rel="stylesheet" type="text/css" href="css/style.css"> <title>練習5-5</title> </head> <body> <h1>padding</h1> <table border=1> <tr> <td>內邊距</td> </tr> </table> <div class="d1"> </div> <div class="d2"> </div> </body> </html>
td{ /*padding: 100px;*/ padding-left: 50px; padding-top: 20px; padding-bottom: 20px; padding-right: 20px; } .d1{ background-color: red; border: solid black 2px; margin: 30px; padding: 20px; width: 50%; height: 300px; } .d2{ background-color: #188417; border: solid #2112CD 10px; margin: 60px; padding: 20px; width: 50%; height: 100px; }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>margin_左右對齊</title> <style type="text/css"> *{ margin: 0; padding: 0; } .container{ width: 70%; height: 1000px; margin: 0 auto; background-color: #A62626; } </style> </head> <body> <div class="container"></div> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>position_左右對齊</title> <style type="text/css"> *{ margin: 0; padding: 0; } /**/ .container{ width: 70%; height: 1000px; background-color: red; position: absolute; left:0px; } </style> </head> <body> <div class="container"></div> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>float_左右對齊</title> <style type="text/css"> *{ margin: 0; padding: 0; } /**/ .container{ width: 70%; height: 1000px; background-color: red; float: right; } </style> </head> <body> <div class="container"></div> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <link rel="stylesheet" type="text/css" href="css/style7.css"> <title>練習7-1 自定義盒子模式</title> </head> <body> <div class="container"> <div class="bd"> <div class="pd"> <div class="content"> 練習7-1 自定義盒子模式 </div> </div> </div> </div> </body> </html>
body{ margin: 0; } .container{ width: 500px; height: 200px; background-color: #1E0CB9; padding: 20px; } .bd{ border: solid 20px #D82323; background-color: #15DF27; } .pd{ background-color: #EFE41B; padding: 20px; } .content{ background-color: #fff; height: 100px; padding: 10px; }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <link rel="stylesheet" type="text/css" href="css/style7-2.css"> <title>7-2.html</title> </head> <body> <div class="head"> <div class="nav"></div> </div> <div class="body"> <div class="slider"> </div> <div class="content"> </div> <div class="footer"> <div class="footer-content"></div> <div class="footer-nav"></div> </div> </div> </body> </html>style7-2.css
*{ margin: 0; padding: 0; } .head{ height: 50px; background-color: #000; } .nav{ width: 75%; height: 50px; margin: 0 auto; background-color: #0000FF; } .body{ /*background-color: #82EED9;*/ } .slider{ width: 75%; margin: 0 auto; height: 300px; background-color: #FFFF00; }
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
width:使用device-width(裝置寬度)作為可視區域的寬度。
initial-scale:初始比例,用1表示100%,範圍從0.1~1可任填。
maximum-scale=1.0
minimum-scale:最小可以縮放到0.8比例
maximum-scale:最大可以縮放到2.0比例
user-scalable:是否允許縮放,1 或 0 (yes 或 no)
一、安裝:
二、容器:
<!-- 自訂樣式表 --> <link rel="stylesheet" type="text/css" href="css/style.css">
當然這時我們必須在 css/ 底下建立一個 style.css 的樣式表
在index.html
<div></div> <div class="container"></div> <div class="container-fluid"></div>
由於三個「div」都沒有內容,所以我們需指定它們的寬、高、背景,這樣才有辦法顯示在瀏覽器上
<div style="height: 100px;background-color: #1312B5"></div>
css/style.css
.container{ height: 100px; background-color: #4BDC55; } .container-fluid{ height: 100px; background-color: #E01FCF; }
頁面由row(列)、column(欄)所組成,資料放在由row、column所組成的框框裡
超小屏幕 手機(<768px) | 小屏幕 平板(≥768px) | 中等屏幕 桌面顯示器(≥992px) | 大屏幕 大桌面顯示器(≥1200px) | |
---|---|---|---|---|
柵格系統行為 | 總是水平排列 | 開始是堆疊在一起的,當大於這些閾值時將變為水平排列C | ||
.container 最大寬度 |
None (自動) | 750px | 970px | 1170px |
類前綴 | .col-xs- |
.col-sm- |
.col-md- |
.col-lg- |
列(column)數 | 12 | |||
最大列(column)寬 | 自動 | ~62px | ~81px | ~97px |
槽(gutter)寬 | 30px (每列左右均有15px) | |||
可嵌套 | 是 | |||
偏移(Offsets) | 是 | |||
列排序 | 是 |
<div class="container"> <div class="row"> <div class="col-md-3"><h2>HTML</h2></div> <div class="col-md-3"><h2>CSS</h2></div> <div class="col-md-3"><h2>JS</h2></div> <div class="col-md-3"><h2>BOOTSTRAP</h2></div> </div> </div>
一、排版:範例 http://tncomu10601.ugm.com.tw/web/9-1.html
<!-- 靠左對齊,預設值 --> <p class="text-left">Left aligned text.</p> <!-- 置中對齊 --> <p class="text-center">Center aligned text.</p> <!-- 靠右對齊 --> <p class="text-right">Right aligned text.</p> <!-- 分散對齊 --> <p class="text-justify">Justified text.</p> <!-- 不換行 --> <p class="text-nowrap">No wrap text.</p>表格
<table class="table table-bordered"> <tr> <td class="text-center">text-center</td> <td class="text-left">text-left</td> <td class="text-right">text-right</td> <td class="text-justify">text-justify</td> <td class="text-nowrap">text-nowrap</td> </tr> </table>
<div class="bg-primary">bg-primary</div> <div class="bg-success">bg-success</div> <div class="bg-info">bg-info</div> <div class="bg-warning">bg-warning</div> <div class="bg-danger">bg-danger</div>
二、表格
<table>
標籤添加 .table
類可以為其賦予基本的樣式—少量的內補(padding)和水平方向的分隔線。.table-striped
類可以給 <tbody>
之內的每一行增加斑馬條紋樣式。.table-bordered
類為表格和其中的每個單元格增加邊框。Class | 描述 |
---|---|
.active |
鼠標懸停在行或單元格上時所設置的顏色 |
.success |
標識成功或積極的動作 |
.info |
標識普通的提示信息或動作 |
.warning |
標識警告或需要用戶注意 |
.danger |
標識危險或潛在的帶來負面影響的動作 |
.table
元素包裹在 .table-responsive
元素內,即可創建響應式表格,其會在小屏幕設備上(小於768px)水平滾動。當屏幕大於768px寬度時,水平滾動條消失。三、響應式圖片
在Bootstrap版本3中,通過為圖片添加 .img-responsive
類可以讓圖片支持響應式佈局。其實質是為圖片設置了 max-width: 100%;
、 height: auto;
和 display: block;
屬性,從而讓圖片在其父元素中更好的縮放。
如果需要讓使用了 .img-responsive
類的圖片水平居中,請使用 .center-block
類,不要用 .text-center
。請參考助手類章節了解更多關於 .center-block
的用法。
<img src="..." class="img-responsive" alt="Responsive image">
<img src="..." alt="圓角" class="img-rounded"> <img src="..." alt="圓形" class="img-circle"> <img src="..." alt="縮圖" class="img-thumbnail">
四、情境文本顏色
<p class="text-muted">...</p> <p class="text-primary">...</p> <p class="text-success">...</p> <p class="text-info">...</p> <p class="text-warning">...</p> <p class="text-danger">...</p>
五、按鈕:http://tncomu10601.ugm.com.tw/web/9-5-1.html
<!-- Standard button --> <button type="button" class="btn btn-default">(默认样式)Default</button> <!-- Provides extra visual weight and identifies the primary action in a set of buttons --> <button type="button" class="btn btn-primary">(首选项)Primary</button> <!-- Indicates a successful or positive action --> <button type="button" class="btn btn-success">(成功)Success</button> <!-- Contextual button for informational alert messages --> <button type="button" class="btn btn-info">(一般信息)Info</button> <!-- Indicates caution should be taken with this action --> <button type="button" class="btn btn-warning">(警告)Warning</button> <!-- Indicates a dangerous or potentially negative action --> <button type="button" class="btn btn-danger">(危险)Danger</button> <!-- Deemphasize a button by making it look like a link while maintaining button behavior --> <button type="button" class="btn btn-link">(链接)Link</button>
.btn-lg
、.btn-sm
或.btn-xs
就可以獲得不同尺寸的按鈕。
<p> <button type="button" class="btn btn-primary btn-lg">(大按钮)Large button</button> <button type="button" class="btn btn-default btn-lg">(大按钮)Large button</button> </p> <p> <button type="button" class="btn btn-primary">(默认尺寸)Default button</button> <button type="button" class="btn btn-default">(默认尺寸)Default button</button> </p> <p> <button type="button" class="btn btn-primary btn-sm">(小按钮)Small button</button> <button type="button" class="btn btn-default btn-sm">(小按钮)Small button</button> </p> <p> <button type="button" class="btn btn-primary btn-xs">(超小尺寸)Extra small button</button> <button type="button" class="btn btn-default btn-xs">(超小尺寸)Extra small button</button> </p>
.btn-block
類可以將其拉伸至父元素100%的寬度,而且按鈕也變為了塊級(block)元素。一、輕鬆的建立互動表單
二、將表單嵌入至網頁
<!DOCTYPE html> <html lang="zh-Hant-TW"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! --> <title>Bootstrap 101 Template</title> <!-- Bootstrap --> <link href="css/bootstrap.min.css" rel="stylesheet"> <!-- 自訂樣式表 --> <link rel="stylesheet" type="text/css" href="css/style.css"> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script> <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script> <![endif]--> <!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> <script src="js/jquery.min.js"></script> <style type="text/css"> </style> </head> <body> <div class="container"> <h1>台南社大網頁設計期中聚餐調查</h1> <iframe src="https://docs.google.com/forms/d/e/1FAIpQLSdy8tcdkLy2pQhrNYfEUOintb7f042rZm1Re3FYqzuypuYX0g/viewform?embedded=true" style="width:100%;height:1700px;" frameborder="0" marginheight="0" marginwidth="0">載入中…</iframe> </div> <!-- Include all compiled plugins (below), or include individual files as needed --> <script src="js/bootstrap.min.js"></script> </body> </html>
三、將Google雲的資料權限設定
無數可複用的組件,包括
一、Glyphicons 字體圖標
<button type="button" class="btn btn-default" aria-label="Left Align"> <span class="glyphicon glyphicon-align-left" aria-hidden="true"></span> </button> <button type="button" class="btn btn-default btn-lg"> <span class="glyphicon glyphicon-star" aria-hidden="true"></span> Star </button>
.sr-only
文本就可以讓輔助設備知道這條提示所要表達的意思了。
<div class="alert alert-danger" role="alert"> <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> <span class="sr-only">Error:</span> Enter a valid email address </div>
二、下拉菜單
<div class="dropdown"> <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> Dropdown <span class="caret"></span> </button> <ul class="dropdown-menu" aria-labelledby="dropdownMenu1"> <li><a href="#">Action</a></li> <li><a href="#">Another action</a></li> <li><a href="#">Something else here</a></li> <li role="separator" class="divider"></li> <li><a href="#">Separated link</a></li> </ul> </div>
.dropup
類,可以讓菜單向上彈出(默認是向下彈出的)。
<div class="container" style="margin-top:400px;"> <div class="dropup"> <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> Dropup <span class="caret"></span> </button> <ul class="dropdown-menu" aria-labelledby="dropdownMenu2"> <li><a href="#">Action</a></li> <li><a href="#">Another action</a></li> <li><a href="#">Something else here</a></li> <li role="separator" class="divider"></li> <li><a href="#">Separated link</a></li> </ul> </div> </div>
三、導航
<ul class="nav nav-tabs"> <li role="presentation" class="active"><a href="#">Home</a></li> <li role="presentation"><a href="#">Profile</a></li> <li role="presentation"><a href="#">Messages</a></li> </ul>
<ul class="nav nav-pills"> <li role="presentation" class="active"><a href="#">Home</a></li> <li role="presentation"><a href="#">Profile</a></li> <li role="presentation"><a href="#">Messages</a></li> </ul>
膠囊是標籤頁也是可以垂直方向堆疊排列的。只需添加.nav-stacked
類。
<ul class="nav nav-pills nav-stacked"> <li role="presentation" class="active"><a href="#">Home</a></li> <li role="presentation"><a href="#">Profile</a></li> <li role="presentation"><a href="#">Messages</a></li> </ul>
四、導航條
<nav class="navbar navbar-default"> <div class="container-fluid"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">Brand</a> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li> <li><a href="#">Link</a></li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">Action</a></li> <li><a href="#">Another action</a></li> <li><a href="#">Something else here</a></li> <li role="separator" class="divider"></li> <li><a href="#">Separated link</a></li> <li role="separator" class="divider"></li> <li><a href="#">One more separated link</a></li> </ul> </li> </ul> <form class="navbar-form navbar-left"> <div class="form-group"> <input type="text" class="form-control" placeholder="Search"> </div> <button type="submit" class="btn btn-default">Submit</button> </form> <ul class="nav navbar-nav navbar-right"> <li><a href="#">Link</a></li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">Action</a></li> <li><a href="#">Another action</a></li> <li><a href="#">Something else here</a></li> <li role="separator" class="divider"></li> <li><a href="#">Separated link</a></li> </ul> </li> </ul> </div><!-- /.navbar-collapse --> </div><!-- /.container-fluid --> </nav>
五、縮略圖
<div class="bs-example" data-example-id="thumbnails-with-custom-content"> <div class="row"> <div class="col-sm-6 col-md-4"> <div class="thumbnail"> <img src="http://fakeimg.pl/800x600/"> <div class="caption"> <h3>Thumbnail label</h3> <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p> <p> <a href="#" class="btn btn-primary" role="button">Button </a> <a href="#" class="btn btn-default" role="button">Button</a> </p> </div> </div> </div> <div class="col-sm-6 col-md-4"> <div class="thumbnail"> <img src="http://fakeimg.pl/800x600/"> <div class="caption"> <h3>Thumbnail label</h3> <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p> <p> <a href="#" class="btn btn-primary" role="button">Button </a> <a href="#" class="btn btn-default" role="button">Button</a> </p> </div> </div> </div> <div class="col-sm-6 col-md-4"> <div class="thumbnail"> <img src="http://fakeimg.pl/800x600/"> <div class="caption"> <h3>Thumbnail label</h3> <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p> <p> <a href="#" class="btn btn-primary" role="button">Button </a> <a href="#" class="btn btn-default" role="button">Button</a> </p> </div> </div> </div> </div> </div>
六、警告框
<div class="alert alert-success" role="alert">...</div> <div class="alert alert-info" role="alert">...</div> <div class="alert alert-warning" role="alert">...</div> <div class="alert alert-danger" role="alert">...</div>
<div class="alert alert-warning alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button> <strong>Warning!</strong> Better check yourself, you're not looking too good. </div>
七、面板
.panel
組件所做的只是設置基本的邊框(border)和內補(padding)來包含內容。
<div class="panel panel-default"> <div class="panel-body"> 基本實例 </div> </div>
通過 .panel-heading
可以很簡單地為面板加入一個標題容器。你也可以通過添加設置了 .panel-title
類的 <h1>
- <h6>
標籤,添加一個預定義樣式的標題。不過, <h1>
- <h6>
標籤的字體大小將被 .panel-heading
的樣式所覆蓋。
為了給鏈接設置合適的顏色,務必將鏈接放到帶有 .panel-title
類的標題標籤內。
<div class="panel panel-default"> <div class="panel-heading">Panel heading without title</div> <div class="panel-body"> 面板內容 </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">面板標題</h3> </div> <div class="panel-body"> 面板內容 </div> </div>
一、下拉選單
二、滾動監聽
<nav class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">網站標題</a> </div> <div> <div class="collapse navbar-collapse" id="myNavbar"> <ul class="nav navbar-nav"> <li><a href="#section1">區塊 1</a></li> <li><a href="#section2">區塊 2</a></li> <li><a href="#section3">區塊 3</a></li> <li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="#">區塊 4 <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#section41">區塊 4-1</a></li> <li><a href="#section42">區塊 4-2</a></li> </ul> </li> </ul> </div> </div> </div> </nav>
<div id="section1" class="container"> <h1>區塊 1</h1> <p>Try to scroll this section and look at the navigation bar while scrolling! Try to scroll this section and look at the navigation bar while scrolling!</p> <p>Try to scroll this section and look at the navigation bar while scrolling! Try to scroll this section and look at the navigation bar while scrolling!</p> </div> <div id="section2" class="container"> <h1>區塊 2</h1> <p>Try to scroll this section and look at the navigation bar while scrolling! Try to scroll this section and look at the navigation bar while scrolling!</p> <p>Try to scroll this section and look at the navigation bar while scrolling! Try to scroll this section and look at the navigation bar while scrolling!</p> </div> <div id="section3" class="container"> <h1>區塊 3</h1> <p>Try to scroll this section and look at the navigation bar while scrolling! Try to scroll this section and look at the navigation bar while scrolling!</p> <p>Try to scroll this section and look at the navigation bar while scrolling! Try to scroll this section and look at the navigation bar while scrolling!</p> </div> <div id="section41" class="container"> <h1>區塊 4 Submenu 1</h1> <p>Try to scroll this section and look at the navigation bar while scrolling! Try to scroll this section and look at the navigation bar while scrolling!</p> <p>Try to scroll this section and look at the navigation bar while scrolling! Try to scroll this section and look at the navigation bar while scrolling!</p> </div> <div id="section42" class="container"> <h1>區塊 4 Submenu 2</h1> <p>Try to scroll this section and look at the navigation bar while scrolling! Try to scroll this section and look at the navigation bar while scrolling!</p> <p>Try to scroll this section and look at the navigation bar while scrolling! Try to scroll this section and look at the navigation bar while scrolling!</p> </div>
<style> body { position: relative; } #section1 {padding-top:50px;height:500px;color: #fff; background-color: #1E88E5;} #section2 {padding-top:50px;height:500px;color: #fff; background-color: #673ab7;} #section3 {padding-top:50px;height:500px;color: #fff; background-color: #ff9800;} #section41 {padding-top:50px;height:500px;color: #fff; background-color: #00bcd4;} #section42 {padding-top:50px;height:500px;color: #fff; background-color: #009688;} </style>
三、標籤頁
data-toggle="tab"
到每個選項卡,並添加一個.tab-pane
類為每個標籤的唯一ID,並在將它們包裝.tab-content
類。<div class="container"> <h2>標籤頁</h2> <ul class="nav nav-tabs"> <li class="active"><a data-toggle="tab" href="#home">Home</a></li> <li><a data-toggle="tab" href="#menu1">Menu 1</a></li> <li><a data-toggle="tab" href="#menu2">Menu 2</a></li> <li><a data-toggle="tab" href="#menu3">Menu 3</a></li> </ul> <div class="tab-content"> <div id="home" class="tab-pane fade in active"> <h3>HOME</h3> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> </div> <div id="menu1" class="tab-pane fade"> <h3>Menu 1</h3> <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p> </div> <div id="menu2" class="tab-pane fade"> <h3>Menu 2</h3> <p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam.</p> </div> <div id="menu3" class="tab-pane fade"> <h3>Menu 3</h3> <p>Eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.</p> </div> </div> </div>
四、工具提示
data-toggle="tooltip"
激活提示。title
屬性指定要在工具提示中顯示的文本。tooltip()
方法。<div class="container"> <h3>Tooltip Example</h3> <p>Tooltips are not CSS-only plugins, and must therefore be initialized with jQuery: select the specified element and call the tooltip() method.</p> <a href="#" data-toggle="tooltip" title="Hooray!" class="tool_tip">Hover over me</a> <h3>工具提示範例2</h3> <p>Tooltips are not CSS-only plugins, and must therefore be initialized with jQuery: select the specified element and call the tooltip() method.</p> <a href="#" data-toggle="tooltip" title="工具提示範例2!" class="tool_tip">Hover over me</a> </div> <script> $(document).ready(function(){ $('.tool_tip').tooltip(); }); </script>
五、折疊:http://tncomu10601.ugm.com.tw/web/12-5.html
<div class="panel-group" id="accordion"> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent="#accordion" href="#collapse1"> Collapsible Group 1</a> </h4> </div> <div id="collapse1" class="panel-collapse collapse in"> <div class="panel-body">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent="#accordion" href="#collapse2"> Collapsible Group 2</a> </h4> </div> <div id="collapse2" class="panel-collapse collapse"> <div class="panel-body">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent="#accordion" href="#collapse3"> Collapsible Group 3</a> </h4> </div> <div id="collapse3" class="panel-collapse collapse"> <div class="panel-body">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</div> </div> </div> </div>
當您懂得HTML的語法,再也不用單打獨鬥自己開發網頁,網站上有很多免費的整套網站系統,可以下載,再修改成自己的網站即可。
Bootstrap免費樣板是我們的首選,它是目前最夯的響應式網站的框架,它會自動調整畫面來適應桌機、平板、手機。
Bootstrap免費樣板 + Github Pages + Sublime text3 + 臉書 + Google雲
讓我們可以用最少的成本,建立超高CP值的網站,來做行銷
一、google搜尋
二、bootstrap免費樣板
Start Bootstrap上的所有免費模板和主題現在都是根據MIT許可而不是Apache 2.0進行授權的。
麻省理工學院的許可證很簡單,它允許你做任何你想要的模板。
簡而言之,使用MIT許可證,您可以使用Start Bootstrap中的任何模板或主題進行商業或私人用途,您可以根據需要分發和/或修改模板。
Start Bootstrap中的每個模板都有一個自定義的CSS文件,有些還有一個自定義的JS文件,它在前幾行代碼中有一個註釋。
Start Bootstrap的全部內容是保持開放源代碼,並保持模板和主題可以使用和擴展到廣泛的用戶。切換到麻省理工學院的許可證只是這個方向的另一個步驟。
三、下載免費的bootstrap theme
四、頁面轉向
<!DOCTYPE html> <html> <head> <meta http-equiv="refresh" content="0;url=new-age/index.html" /> </head> </html>
五、使用JQUERY套件
六、BACKSTRETCH 輪播插件
http://www.jquery-backstretch.com/
backstretch 一個簡單的jQuery插件,它允許你動態調整大小,幻燈片功能的背景圖像添加到任何頁面或元素( MIT license.)
<script src="js/backstretch/jquery.backstretch.min.js"></script>
<script type="text/javascript"> $(document).ready(function(){ $('.top-content').backstretch([ "img/3.jpg" , "img/2.jpg" , "img/1.jpg" ], {duration: 3000, fade: 750}); }); </script>
一、網頁應該注意事項
<title>modal 模態彈窗 bootstrap 育將電腦工作室</title>
<meta name="author" content="作者名稱"> <meta name="copyright" content="版權所有人名稱">
<meta name="keywords" content="肉乾,肉鬆,肉脯,豬肉乾,豬肉鬆,魚鬆,魚脯,杏仁肉乾,乾貨零嘴,臘味肉品,贈品禮盒,馨香珍,香腸"> <meta name="description" content="馨香珍肉鬆肉乾專賣店,訂購專線(日)06-595-8300、(夜)06-213-7301(行動)0916-055028、0970-426206,台南市關廟區市場內67號"> <meta name="robots" content="index,follow"> <meta name="rating" content="general"> <meta name="author" content="育將電腦工作室"> <meta name="generator" content="XOOPS">例:香純豬肉鬆
<!-- Favicon --> <link rel="shortcut icon" type="image/ico" href="https://www.jinghung.com/themes/u_jinghung/icon/favicon.ico"> <link rel="icon" type="image/png" href="https://www.jinghung.com/themes/u_jinghung/icon/favicon.png">
<meta property="og:title" content="網站名稱或標題" > <meta property="og:url" content="網址"> <meta property="og:image" content="要顯示的縮圖網址"> <meta property="og:description" content="網頁描述" >
二、做好網頁優化提升網站搜尋排名
三、善用Google的網站管理工具:Search Console
一、前言:Google分析本身可以提供訪客瀏覽人次、網頁瀏覽人次、用戶的瀏覽器、作業系統、螢幕解析度、網站熱門文章、熱門關鍵字、訪客來自於何處等等資料,十分的詳細,而且這些資料都是儲存在Google伺服器,不用擔心自己網站掛了資料不見,也不必擔心統計這些資料會讓資料庫爆掉喔!
二、註冊:https://analytics.google.com/analytics/web/provision/?authuser=0#provision/SignUp/
三、取得網站追蹤程式碼
四、觀看流量來源
一、嵌入Google地圖
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3673.221962794082!2d120.19572831442864!3d22.978863984975167!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x346e75d66763542d%3A0x75457923247277f7!2z6Ie65Y2X5biC56uL5aSn5oiQ5ZyL5rCR5Lit5a24!5e0!3m2!1szh-TW!2stw!4v1498002096290" width="1170" height="300" frameborder="0" style="border:0" allowfullscreen></iframe>
<li> <a class="page-scroll" href="#maps">電子地圖</a> </li>
<!-- 電子地圖 --> <section id="maps" class="maps"> <div class="container"> <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3673.221962794082!2d120.19572831442864!3d22.978863984975167!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x346e75d66763542d%3A0x75457923247277f7!2z6Ie65Y2X5biC56uL5aSn5oiQ5ZyL5rCR5Lit5a24!5e0!3m2!1szh-TW!2stw!4v1498002577802" style="width:100%;height:300px;" frameborder="0" style="border:0" allowfullscreen></iframe> </div> </section>new-agenew-age/css/new-age.css
/* ugm */ .maps{ background: url("../img/bg-pattern.png"), #7b4397; /* fallback for old browsers */ background: url("../img/bg-pattern.png"), -webkit-linear-gradient(to left, #7b4397, #dc2430); /* Chrome 10-25, Safari 5.1-6 */ background: url("../img/bg-pattern.png"), linear-gradient(to left, #7b4397, #dc2430); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */ }
二、將影音放上Youtube,再嵌入網站
三、google日曆
一、成立臉書粉絲專頁
粉絲專頁可協助企業、品牌、組織及公眾人物分享動態,與用戶連結。如同個人檔案一樣,您可以自訂粉絲專頁的動態和活動等內容。對粉絲專頁按讚或加以追蹤的用戶會在動態消息中收到該專頁的更新內容。
若要建立粉絲專頁:
二、美化粉絲頁
一、申請 Facebook APP ID
二、社交外掛程式:https://developers.facebook.com/docs/plugins/like-button
<!-- Facebook 客服 --> <style type="text/css"> .fab-fixed-wrap { position: fixed; z-index: 1045; right: 30px; bottom: 30px; } .fa { display: inline-block; font: normal normal normal 14px/1 FontAwesome; font-size: inherit; text-rendering: auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .fab { font-size: 32px; display: block; width: 56px; height: 56px; border-radius: 50%; color: #fff; background-color: #e89a3e; text-align: center; box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 1px 1px rgba(0,0,0,0.175); text-decoration: none; line-height: 50px; opacity: 0.8; } .fab-facebook { background-color: #e8ac3e; } .fab-facebook:hover, .fab-facebook:focus, .fab-facebook:active { outline: 0; opacity: 0.6; color: #eee; } </style> <div class="fab-fixed-wrap"> <a href="https://www.messenger.com/t/tw.ugm" target="_blank" class="fab fab-facebook" title="Facebook 客服"> <span class="h2"> <span class="fa fa-comments-o"></span> </span> </a> </div>