everything goes well
8 Feb
在我一个同事的blog里面看到的,搜集过来了。
1.CSS字体属性简写规则一般用CSS设定字体属性是这样做的:
font-weight:bold;
font-style:italic;
font-varient:small-caps;
font-size:1em;
line-height:1.5em;
font-family:verdana,sans-serif;
但也可以把它们全部写到一行上去:
14 Jan
最近频频接触CSS,对不同浏览器的显示效果不同很纠结。现再收集一下关于IE的hack。
1. 区别FF和IE
1-1
首先,当然是!important大法,可以提升指定样式规则的应用优先权,如下面的例子:
插入代码:
div{
background-color: red !important;
background-color: blue;
}
因为!important声明在IE6中并不是绝对的,它会被之后的同名属性定义所替换。也就是说在上面的例子中,IE6所应用的是最后一个背景色的值,即“blue”;而在FF中背景色的值为“red”。
(more…)
14 Jan
由于IE与Firefox对CSS的解释不同,往往让我们在对一个图片处于一个div内垂直居中的问题伤透脑筋。上一篇讲述到用top:50%的方法,现在再展开补充说明一下。
29 Dec
很多朋友在编写html的时候往往会被一些小问题所困扰,这里介绍几个小小的技巧。
1. 防止图片撑破div层
.div-img {margin: auto; width: 600px;}
.div-img img{max-width: 100%!important; height: auto!important; width:expression(this.width > 600 ? “600px” : this.width)!important;}
2. 让div的内容图片垂直居中(可兼容多浏览器)
.div-img {*position:absolute; top:50%;}
.div-img img {*position:relative; top:-50%; left:-50%;}
3. 让文字从右往左竖排写
.text { layout-flow: vertical-ideographic; height:400px; line-height:200%; }
11 Dec
今天讲解一下一个简单而实用的CSS属性:min-height,它允许你指定元素的最小高度,在需要平衡布局时非常有用。看看下面的图解就一目了然了。 (more…)
9 Nov
Internet Explorer 6 is outdated and insecure, it looked terrible, but many users still using it.
Adding the NOTIFICATION on your site to help phase out Internet Explorer 6 forever. They tells visitors using Internet Explorer 6 that they need to upgrade to the current version or switch to another browser right now.

最新评论