从今天开始学习bootstrap。最终目标是写一个网站的前端。
Bootstrap makes use of certain HTML elements and CSS properties that require the use of the HTML5 doctype. Include it at the beginning of all your projects.--这个是bootstrap官方文档上一段话,翻译过来的大意就是html你要这么写:
<!DOCTYPE html>
<html lang="en">
...
</html>
1、布局
通过加class="container"实现布局。container里有padding-right和padding-left,都是20px。
如果想要达到左右布局,如下图
代码如下:
<div class="container-fluid">
<div class="row-fluid">
<div class="span6 bb1">
aa
</div>
<div class="span6 bb1">
aa
</div>
</div>
</div>
其中bb1是我自己写的一个样式,就是给两个div加上边框。
不知道怎么实现像文档里显示的圆角效果,是另外的css样式么?明天研究这个吧!下班了!要走人了!
补充:
刚刚看了一下,下面这个效果用下面的css:
css:
.mini-layout {
border: 1px solid #ddd;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.075);
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.075);
box-shadow: 0 1px 2px rgba(0,0,0,.075);
}
这个就能实现圆角带阴影的边框了。可以跟container这个class一起用。把之前自己写的那个bb1替换成这个,再加上height和background,就是下面的效果喽!比上面那个高端洋气许多啊!
没有测试浏览器的兼容。