Skip to content

hgnc-fe/ife-spring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

baidu IFE 2016年春任务代码

git pages静态页面演示平台的使用

项目Settings选项下Launch automatic page generator按钮,一路默认,会在远端新建gh-pages分支 本地 git fetch --all 取回所有分支branch更新

$ git fetch --all # 取回所有branch更新
$ git branch # 查看本地所有分支
$ git branch gh-pages origin/gh-pages # 在本地创建和远端对应的分支
$ git checkout gh-pages # 从master切换到gh-pages分支
$ git reset --hard gh-pages # 直接merge会冲突,返回上一次提交版本
$ git rm index.html # 删除本地冲突文件

# 同步本地和远端的代码
$ git add .
$ git commit -m "syn"
$ git pull origin gh-pages
$ git push origin gh-pages

# 和master主分支合并
$ git merge master 

# 访问
http: //<username>.github.io/<projectname/xxx.html>
http://<organizationname>.github.io/<projectname/xxx.hello.html>

如果以后每次切换到master提交则需要切换到pages分支并merge主分支,push后远程即可更新。

水平和垂直居中问题

块元素的最简单的居中方案就是指定一个宽度,并将其左右的margin值设置为auto inline-block的元素设置text-align:center,例如:img,input等

子元素设置浮动后,父元素的高度为0的解决方案

给父元素加入overflow:hidden即可。

任务七的section2中有4个并列显示的inline-block元素,需要这4个元素均分宽度,所以每个元素的宽度设置为25%,但是问题出现了最后一个元素跑到下面去了,最后给父元素设置了font-size:0属性后完美解决。

如何控制背景图片的大小

设置background-size属性即可,该属性有两个参数,分别表示宽高。

更加语义化的html5

我们常用普通文本框input做搜索框,但是html5也提供了类型为search的input。

html5的progress标签设置css有兼容性问题,参见张鑫旭的博客

左边侧栏定宽,右侧内容自适应

article
	aside
	section
article{
	margin-left:250px;
}	
aside{
	width:260px;
	margin-left:-260px;
	float:left
}
section{
	width:100%;
}

弹性盒模型

在Flex容器中,当margin设置为“auto”时,设置自动的垂直边距将使该项目完全集中两个轴。(水平垂直居中),详情参见:sf.gg使用弹性盒模型我们在制作导航菜单的时候我们不需要设置子元素li浮动或者display:inline-block,只需要声明ul为弹性容器即可。

任务列表

阶段一

阶段二

About

The code of the baidu ife task are here

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published