来源:自学PHP网 时间:2015-04-14 14:51 作者: 阅读:次
[导读] DIV等标签中的内容垂直居中: ****************DIV 内容垂直居中样式 Begin:************* verticalMiddle{display: -webkit-box;-webkit-box-orient: horizontal;-webkit-box-pack: center;-web...
//DIV等标签中的内容垂直居中: /****************DIV 内容垂直居中样式 Begin:*************/ .verticalMiddle{display: -webkit-box; -webkit-box-orient: horizontal; -webkit-box-pack: center; -webkit-box-align: center; display: -moz-box; -moz-box-orient: horizontal; -moz-box-pack: center; -moz-box-align: center; display: -o-box; -o-box-orient: horizontal; -o-box-pack: center; -o-box-align: center; display: -ms-box; -ms-box-orient: horizontal; -ms-box-pack: center; -ms-box-align: center; display: box; box-orient: horizontal; box-pack: center; box-align: center; } /* DIV等标签中内容垂直居中样式 End:*/
//position:为了制作更多复杂的布局,我们需要讨论下
position:relative;
position:fixed; 一个固定定位(position属性的值为fixed)元素会相对于视窗来定位,这意味着即便页面滚动,它还是会停留在相同的位置。和 position:absolute;
参考资料:http://blog.csdn.net/sunlovefly2012/article/details/15026233
// 请看下面例子: .box { 在这个例子中, section 元素实际上是在 div 之后的(译注:DOM结构上)。然而 div 元素是浮动到左边的,于是 section 中的文字就围绕了 div ,并且section 元素包围了整个元素。如果我们想让 section 显示在浮动元素之后呢? 使用 clear 我们就可以将这个段落移动到浮动元素 div 下面。你需要用 left 值才能清除元素的向左浮动。你还可以用 right 或 both 来清除向右浮动或同时清除向左向右浮动。 效果图:
使用 .afterDiv{ clear:left; } 效果图:
盒模型 效果:
当你设置一个元素为 .simple { -webkit-box-sizing: border-box; } -webkit-box-sizing: border-box;
|
自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习
京ICP备14009008号-1@版权所有www.zixuephp.com
网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com