1、Div的垂直居中的问题
vertical-align:middle; 将行距增加到和整个DIV一样高 line-height:200px; 然后插入文字,就垂直居中了。缺点是要控制内容不要换行
2、IE6下图片有空隙产生
解决这个BUG的方法也有很多,可以是改变html的排版,或者设置img 为display:block 或者设置vertical-align 属性为vertical-align:top bottom middle text-bottom 都可以解决.
3、IE6、IE7、Firefox之间 的兼容写法
1):
IE都能识别*;标准浏览器(如Firefox)不能识别*;
IE6能识别*,但不能识别 !important,
IE7能识别*,也能识别!important;
Firefox不能识别*,但能识别!important;
根据上述表达,同一类/ID下的CSS hack可写为:
.searchInput {
background-color:#333;/*三者皆可*/
*background-color:#666 !important; /*仅IE7*/
*background-color:#999; /*仅IE6及IE6以下*/
}
2):IE6可识别“_”,而IE7及Firefox皆不能识别,所以当只针对IE6与IE7及Firefox之间的区别时,可这样书写:
.searchInput {
background-color:#444;/*通用*/
_background-color:#555;/*仅IE6可识别*/
}
3):*+html 与 *html 是IE特有的标签, Firefox 暂不支持。
.searchInput {background-color:#333;}
*html .searchInput {background-color:#666;}/*仅IE6*/
*+html .searchInput {background-color:#555;}/*仅IE7*/