Bootstrapç¬è®°
程序员文章站
2023-12-28 20:44:22
...
Bootstrapï¼
1. æ¦å¿µï¼ ä¸ä¸ªå端å¼åçæ¡æ¶ï¼Bootstrapï¼æ¥èª Twitterï¼æ¯ç®åå¾å欢è¿çå端æ¡æ¶ãBootstrap æ¯åºäº HTMLãCSSãJavaScript çï¼å®ç®æ´çµæ´»ï¼ä½¿å¾ Web å¼åæ´å å¿«æ·ã
* æ¡æ¶:ä¸ä¸ªåæå软件ï¼å¼å人åå¯ä»¥å¨æ¡æ¶åºç¡ä¸ï¼å¨è¿è¡å¼åï¼ç®åç¼ç ã
* 好å¤ï¼
1. å®ä¹äºå¾å¤çcssæ ·å¼åjsæ件ãæ们å¼å人åç´æ¥å¯ä»¥ä½¿ç¨è¿äºæ ·å¼åæ件å¾å°ä¸°å¯ç页é¢ææã
2. ååºå¼å¸å±ã
* åä¸å¥é¡µé¢å¯ä»¥å
¼å®¹ä¸åå辨çç设å¤ã
2. å¿«éå
¥é¨
1. ä¸è½½Bootstrap
2. å¨é¡¹ç®ä¸å°è¿ä¸ä¸ªæ件夹å¤å¶
3. å建html页é¢ï¼å¼å
¥å¿
è¦çèµæºæ件
<!DOCTYPE html>
<html lang="zh-CN">
<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 HelloWorld</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
â
ä½ å¥½ï¼ä¸çï¼
</body>
</html>
ååºå¼å¸å±
* åä¸å¥é¡µé¢å¯ä»¥å
¼å®¹ä¸åå辨çç设å¤ã
* å®ç°ï¼ä¾èµäºæ
æ ¼ç³»ç»ï¼å°ä¸è¡å¹³ååæ12ä¸ªæ ¼åï¼å¯ä»¥æå®å
ç´ å å ä¸ªæ ¼å
* æ¥éª¤ï¼
1. å®ä¹å®¹å¨ãç¸å½äºä¹åçtableã
* 容å¨åç±»ï¼
1. containerï¼ä¸¤è¾¹çç½
2. container-fluidï¼æ¯ä¸ç§è®¾å¤é½æ¯100%宽度
2. å®ä¹è¡ãç¸å½äºä¹åçtr æ ·å¼ï¼row
3. å®ä¹å
ç´ ãæå®è¯¥å
ç´ å¨ä¸åç设å¤ä¸ï¼æå çæ ¼åæ°ç®ãæ ·å¼ï¼col-设å¤ä»£å·-æ ¼åæ°ç®
* 设å¤ä»£å·ï¼
1. xsï¼è¶
å°å±å¹ ææº (<768px)ï¼col-xs-12
2. smï¼å°å±å¹ å¹³æ¿ (â¥768px)
3. mdï¼ä¸çå±å¹ æ¡é¢æ¾ç¤ºå¨ (â¥992px)
4. lgï¼å¤§å±å¹ 大æ¡é¢æ¾ç¤ºå¨ (â¥1200px)
* 注æï¼
1. ä¸è¡ä¸å¦ææ ¼åæ°ç®è¶
è¿12ï¼åè¶
åºé¨åèªå¨æ¢è¡ã
2. æ
æ ¼ç±»å±æ§å¯ä»¥åä¸å
¼å®¹ãæ
æ ¼ç±»éç¨äºä¸å±å¹å®½åº¦å¤§äºæçäºåçç¹å¤§å°ç设å¤ã
3. å¦æçå®è®¾å¤å®½åº¦å°äºäºè®¾ç½®æ
æ ¼ç±»å±æ§ç设å¤ä»£ç çæå°å¼ï¼ä¼ä¸ä¸ªå
ç´ æ²¾æ»¡ä¸æ´è¡ã
CSSæ ·å¼åJSæ件
1. å
¨å±CSSæ ·å¼ï¼
* æé®ï¼class="btn btn-default"
* å¾çï¼
* class="img-responsive"ï¼å¾çå¨ä»»æ尺寸é½å 100%
* å¾çå½¢ç¶
* <img src="..." alt="..." class="img-rounded">ï¼æ¹å½¢
* <img src="..." alt="..." class="img-circle"> ï¼ åå½¢
* <img src="..." alt="..." class="img-thumbnail"> ï¼ç¸æ¡
* è¡¨æ ¼
* table
* table-bordered
* table-hover
* 表å
* ç»è¡¨å项添å ï¼class="form-control"
2. ç»ä»¶ï¼
* 导èªæ¡
* å页æ¡
3. æ件ï¼
* è½®æå¾
æ¡ä¾
<!DOCTYPE html>
<html lang="zh-CN">
<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 HelloWorld</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
â
â
â
</header>
<!-- 2.主ä½é¨å-->
<div class="container">
<div class="row jx">
<img src="img/icon_5.jpg">
<span>é»é©¬ç²¾é</span>
</div>
<div class="row paddtop">
<div class="col-md-3">
<div class="thumbnail">
<img src="img/jiangxuan_3.jpg" alt="">
<p>ä¸æµ·ç´é£ä¸äº5天4æèªç±è¡(æ¥èé¢å®+亲å/èæ/ä¼é²æ¸¸é¦é+豪åé
åºä»»é+æ¥éæº)</p>
<font color="red">¥ 699</font>
</div>
</div>
<div class="col-md-3">
<div class="thumbnail">
<img src="img/jiangxuan_3.jpg" alt="">
<p>ä¸æµ·ç´é£ä¸äº5天4æèªç±è¡(æ¥èé¢å®+亲å/èæ/ä¼é²æ¸¸é¦é+豪åé
åºä»»é+æ¥éæº)</p>
<font color="red">¥ 699</font>
</div>
</div>
<div class="col-md-3">
<div class="thumbnail">
<img src="img/jiangxuan_3.jpg" alt="">
<p>ä¸æµ·ç´é£ä¸äº5天4æèªç±è¡(æ¥èé¢å®+亲å/èæ/ä¼é²æ¸¸é¦é+豪åé
åºä»»é+æ¥éæº)</p>
<font color="red">¥ 699</font>
</div>
</div>
<div class="col-md-3">
<div class="thumbnail">
<img src="img/jiangxuan_3.jpg" alt="">
<p>ä¸æµ·ç´é£ä¸äº5天4æèªç±è¡(æ¥èé¢å®+亲å/èæ/ä¼é²æ¸¸é¦é+豪åé
åºä»»é+æ¥éæº)</p>
<font color="red">¥ 699</font>
</div>
</div>
â
å½å 游
ä¸æµ·ç´é£ä¸äº5天4æèªç±è¡(æ¥èé¢å®+亲å/èæ/ä¼é²æ¸¸é¦é+豪åé åºä»»é+æ¥éæº)
¥ 699
ä¸æµ·ç´é£ä¸äº5天4æèªç±è¡(æ¥èé¢å®+亲å/èæ/ä¼é²æ¸¸é¦é+豪åé åºä»»é+æ¥éæº)
¥ 699
</div>
<div class="col-md-4">
<div class="thumbnail">
<img src="img/jiangxuan_3.jpg" alt="">
<p>ä¸æµ·ç´é£ä¸äº5天4æèªç±è¡(æ¥èé¢å®+亲å/èæ/ä¼é²æ¸¸é¦é+豪åé
åºä»»é+æ¥éæº)</p>
<font color="red">¥ 699</font>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="thumbnail">
<img src="img/jiangxuan_3.jpg" alt="">
<p>ä¸æµ·ç´é£ä¸äº5天4æèªç±è¡(æ¥èé¢å®+亲å/èæ/ä¼é²æ¸¸é¦é+豪åé
åºä»»é+æ¥éæº)</p>
<font color="red">¥ 699</font>
</div>
</div>
<div class="col-md-4">
<div class="thumbnail">
<img src="img/jiangxuan_3.jpg" alt="">
<p>ä¸æµ·ç´é£ä¸äº5天4æèªç±è¡(æ¥èé¢å®+亲å/èæ/ä¼é²æ¸¸é¦é+豪åé
åºä»»é+æ¥éæº)</p>
<font color="red">¥ 699</font>
</div>
</div>
<div class="col-md-4">
<div class="thumbnail">
<img src="img/jiangxuan_3.jpg" alt="">
<p>ä¸æµ·ç´é£ä¸äº5天4æèªç±è¡(æ¥èé¢å®+亲å/èæ/ä¼é²æ¸¸é¦é+豪åé
åºä»»é+æ¥éæº)</p>
<font color="red">¥ 699</font>
</div>
</div>
â
</div>
</div>
</div>
<!-- 3.页èé¨å-->
<footer class="container-fluid">
<div class="row">
<img src="img/footer_service.png" class="img-responsive">
</div>
<div class="row company">
æ±èä¼ æºæ客æè²ç§æè¡ä»½æéå
¬å¸ çæææCopyright 2006-2018, All Rights Reserved èICPå¤16007882
</div>
</footer>
â