找回密码
 立即注册
搜索
查看: 322|回复: 0

Web 前端框架 Bootstrap

[复制链接]

266

主题

0

回帖

1119

积分

管理员

积分
1119
发表于 2023-12-19 01:34:35 | 显示全部楼层 |阅读模式

简介

Bootstrap 是由 Twitter 设计师 Mark Otto 和 Jacob Thornton 合作开发的 Web 前端开发框架。它提供了很多前端开发中常用的 CSS 和 Javascript 功能。这使得在前端开发中不需要再那么在意 div 等 HTML 元素的宽度、高度等细节,使得开发过程变更加轻而易举。Bootstrap 的响应式栅格系统和 Mobile First 的设计思想,使得页面可以很好地适应于各种流行的屏幕尺寸。

文件结构

bootstrap/
├── css/
│   ├── bootstrap.css
│   ├── bootstrap.css.map
│   ├── bootstrap.min.css
│   ├── bootstrap-theme.css
│   ├── bootstrap-theme.css.map
│   └── bootstrap-theme.min.css
├── js/
│   ├── bootstrap.js
│   └── bootstrap.min.js
└── fonts/
    ├── glyphicons-halflings-regular.eot
    ├── glyphicons-halflings-regular.svg
    ├── glyphicons-halflings-regular.ttf
    ├── glyphicons-halflings-regular.woff
    └── glyphicons-halflings-regular.woff2

css 文件夹:

bootstrap*.css 是 Bootstrap 的核心 CSS 文件;

bootstrap-theme*.css 是一个可选的Bootstrap主题文件,可以根据需要来引用。

Javascript 插件依赖于 jQuery 库,所以使用的时候注意要引用相应的 jQuery 文件。

Bootstrap 使用了 glyphicons.com 提供的矢量 Web 字体替代了传统的图片格式图标,可以像使用文字一样灵活地使用图标。

基本模板

使用 Bootstrap 时可以仿照下面的模板来创建一个页面:

<!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 101 Template</title>

    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet">

    <!-- 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="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body>
    <h1>你好,世界!</h1>

    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="js/bootstrap.min.js"></script>
  </body>
</html>

参考资料

Bootstrap 起步:http://v3.bootcss.com/getting-started/


您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|棱讯科技 ( 粤ICP备2024228160号-2|粤公网安备44030002003510号 )

GMT+8, 2024-7-27 18:58 , Processed in 0.017898 second(s), 5 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表