bootstrap学习记录
给实验室做了个主页,用原生的html和css写的。因为学校提供的ftp不能自己建数据库,主页是静态的,我也没去学习javascript。出于理科的思维,我认为网页在干净整洁的基础上只要做到导航明确,信息分类合理,没有重复冗余就行了,但是一年过去了,实验室的师姐师妹们都很羡慕别人家的网页做得很好看,特别是现在的升学季,觉得自家的主页太丑了。这就是现在要学习bootstrap的缘起。
首先打开bootstrap的官网(http://getbootstrap.com),从Getting started看起。它首先提供了4种bootstrap的使用方式——本地的极简版、Less版、Sass版和CDN版。然后推荐适用bower管理web文件,那么bower是啥呢?
打开bower的官网(bower.io),上面说了bower是一个web的包管理器,至于怎么管理先不管了,装了先。结果安装的时候它说要用npm,
npm install -g bower
所以又要去安装npm,可是npm是啥呢?打开npm的官网(https://www.npmjs.com),可以看到它的介绍说npm是javascript的包管理器,还说如果安装了node.js就不用装了,没有就去安装node.js就好了。OK,node.js有是啥?
打开node.js的官网(https://nodejs.org),介绍中的几个词不太理解确切的含义,好像是说node.js是运行在chrome V8(V8是google的一个开源的高性能JavaScript引擎,C++编写)上的JavaScript,npm是它的包生态系统。
然后下载了它的v4.2.4LTS,解压到家目录下的opt文件夹,更新PATH就安装好了。
zhou@GEOCHEM:~$ npm install -g bower
/home/zhou/opt/node-v4.2.4-linux-x64/bin/bower -> /home/zhou/opt/node-v4.2.4-linux-x64/lib/node_modules/bower/bin/bower
bower@1.7.2 /home/zhou/opt/node-v4.2.4-linux-x64/lib/node_modules/bower
└── semver-utils@1.1.1
然后安装bootstrap,输入
bower install bootstrap
结果提示没有找到git,才想起来bower有提到它需要git,git听说过,但一直不知道该怎么用。打开git的官网(http://git-scm.com),上面说git是一个免费和开源的分布式版本控制系统,用于高效解决项目问题,易学占空间小。
现在按照try git一步步做下去
sudo apt-get install git
git init # 初始化,在家目录下建个.git文件夹
git status # 查看状态
git add octobox.txt # 将文件放到staging area
git status #
git commit -m "Add cute octocat story" # 提交到库中
git log # 操作日志,提交过哪些文件及说明
git remote add origin https://github.com/try-git/try_git.git # 不明白,定义一个远程端?
git push -u origin master # 建立本地和远程之间的联系?
git pull origin master #
git diff HEAD
git diff -- staged
git reset octofamily/octodog.txt
git checkout -- octocat.txt
git branch clean_up # 创建clean_up分支
git checkout clean_up # 转入clean_up分支
git rm '*.txt' # 删除文件树上的文件
git merge clean_up
git branch -d clean_up # 删除分支
坑爹,这么麻烦,不过应该跟我们的bootstrap没关系,差点淹死在里面。现在是这样
zhou@GEOCHEM:~$ bower install bootstrap
bower bootstrap#* not-cached git://github.com/twbs/bootstrap.git#*
bower bootstrap#* resolve git://github.com/twbs/bootstrap.git#*
bower bootstrap#* download https://github.com/twbs/bootstrap/archive/v3.3.6.tar.gz
bower bootstrap#* extract archive.tar.gz
bower bootstrap#* resolved git://github.com/twbs/bootstrap.git#3.3.6
bower jquery#1.9.1 - 2 not-cached git://github.com/jquery/jquery-dist.git#1.9.1 - 2
bower jquery#1.9.1 - 2 resolve git://github.com/jquery/jquery-dist.git#1.9.1 - 2
bower jquery#1.9.1 - 2 download https://github.com/jquery/jquery-dist/archive/2.2.0.tar.gz
bower jquery#1.9.1 - 2 extract archive.tar.gz
bower jquery#1.9.1 - 2 resolved git://github.com/jquery/jquery-dist.git#2.2.0
bower bootstrap#~3.3.6 install bootstrap#3.3.6
bower jquery#1.9.1 - 2 install jquery#2.2.0bootstrap#3.3.6 bower_components/bootstrap
└── jquery#2.2.0jquery#2.2.0 bower_components/jquery
不过放在家目录不合适,所以删了重新在opt里安装。
浙公网安备 33010602011771号