兼容各个浏览器的未知高度div垂直居中效果:让div垂直居中与它的父对象中,并不像是让div在父元素中水平居中那么简单,只要简单的为此元素设置margin:0px auto即可,虽然将一些属性配合使用也可以将div垂直居中与父元素中,但是在某些浏览器中并不兼容,下面就介绍一种兼容各大浏览器的方式。先...
分类:
其他好文 时间:
2015-07-10 18:19:07
阅读次数:
130
1 /** 2 * 使用offsetLeft,需注意margin的使用 3 * offsetLeft = margin-left + left; 4 * offsetWidth= padding + border + width; 5 * 6 * @author Lonve...
分类:
Web程序 时间:
2015-07-10 13:14:22
阅读次数:
114
//注意屏幕宽度从大到小 .abc{ height:300px; border:1px solid #000; margin:0 auto} @media screen and (min-width: 1201px) { .abc {width: 1200px} ...
分类:
其他好文 时间:
2015-07-10 12:56:01
阅读次数:
106
众所周知,浏览器会为我们创建基本的样式。比如,我们不需要为它写任何css样式,在浏览器上展示出来,一眼就只知道它是大标题。问题是,不同浏览器之间的默认效果不尽相同,于是乎,在Chrome下很漂亮的样式,去到Firefox下可能整个页面都变得一团糟(当然也有可能是其他原因)。举个栗子,IE浏览器下的标签的margin-left值为30pt,但是在Firefox,Chrome,Safar...
分类:
其他好文 时间:
2015-07-10 11:31:15
阅读次数:
118
*{
margin:0;
padding:0;
}
.center{
text-align: center;
}
...
分类:
其他好文 时间:
2015-07-09 17:59:06
阅读次数:
137
btn2.css /*--按钮1--*/
.container1?{
??width:200px;
??display:block;
??margin:20px?auto;
??position:relative;
??font-family:droid?arabic?kufi;
}
.con_down1?{
??display:block;
??...
分类:
其他好文 时间:
2015-07-09 16:23:12
阅读次数:
205
在进行表单布局的时候通常会遇到这样的情况文本和textarea标签是底部对齐的邮箱 #content .form p em{ display: inline-block; width:70px; text-align: right; margin-right: 20px;}上...
分类:
其他好文 时间:
2015-07-09 12:50:50
阅读次数:
407
border-radius制作半圆与制作圆形的方法是一样的,只是元素的宽度与圆角方位要配合一致,不同的宽度和高度比例,以及圆角方位,可以制作上半圆、下半圆、左半圆和右半圆效果。例如:.semicircle { margin: 30px; } .top { width: 100px;/*宽度为高度的....
分类:
Web程序 时间:
2015-07-08 20:54:17
阅读次数:
144
范例1body li{color:red;background_color:darkred}范例2#sidebar p { font-style: italic; text-align: right; margin-top: 0.5em; }只有id为siderbar的块中的p会有如上变化(字体。。...
分类:
Web程序 时间:
2015-07-08 16:23:02
阅读次数:
113
前端开发框架Bootstrap 网址:http://www.dnzs.com.cn/w3cschool/bootstrap/bootstrap-tutorial.html需要加入代码一起三段代码css代码.wrap{/*width: 980px;*/ margin: 0 auto;}@media(m...
分类:
其他好文 时间:
2015-07-08 12:24:07
阅读次数:
143