升级+换模版+测试
Friday, March 28th, 2008CSS 书写顺序建议
Friday, November 30th, 2007来自Mozilla的CSS书写规范建议:
//显示属性
display
list-style
position
float
clear
//自身属性
width
height
margin
padding
border
background
//文本属性
color
font
text-decoration
text-align
vertical-align
white-space
other text
content
浏览器 Hack:
test:791px!important; /*FF Hack*/
*test:785px!important; /*IE7 Hack*/
test:777px; /*IE7以下*/
CSS 属性表 (简表)
Thursday, September 13th, 2007属性名称 属性含义 属性值
字体属性(Font)
font-family 使用什么字体 所有的字体
font-style 字体是否斜体 Normal、italic、oblique
font-variant 是否用小体大写 Normal、small-caps
font-weight 字体的粗细 Normal、bold、bolder、lithter等
font-size 字体的大小 Absolute-size、relative-size、length、percentage等
颜色和背景属性
Color 定义前景色 颜色
Background-color 定义背景色 颜色
Background-image 定义背景图案 路径
Background-repeat 重复方式 Repeat-x、repeat-y、no-repeat
Background-attachment 设置滚动 Scroll、Fixed
Background-position 初始位置 Percentage、length、top、left、right、bottom等
文本属性
Word-spacing 单词之间的间距 Normal <length>
Letter-spacing 字母之间的间距 Normal <length>
Text-decoration 文字的装饰样式 None|underline|overline|line-through|blink
Vertical-align 垂直方向的位置 Baseline|sub|super|top|text-top|middle|bottom|text-bottom
Text-transform 文本转换 Capitalize|uppercase|lowercase|none
Text-align 对齐方式 Left|right|center|justify
Text-indent 首行的缩进方式 <length>|<percentage>
Line-height 文本的行高 Normal|<number>|<length>|<percentage>
边距属性
Margin-top 顶端边距 Length|percentage|auto
Margin-right 右侧边距 Length|percentage|auto
Margin-bottom 底端边距 Length|percentage|auto
Margin-left 左侧边距 Length|percentage|auto
填充距属性
Padding-top 顶端填充距 Length|percentage
Padding-right 右侧填充距 Length|percentage
Padding-bottom 底端填充距 Length|percentage
Padding-left 左侧填充距 Length|percentage
边框属性
Border-top-width 顶端边框宽度 Thin|medium|thick|length
Border-right-width 右侧边框宽度 Thin|medium|thick|length
Border-bottom-width 底端边框宽度 Thin|medium|thick|length
Border-left-width 左侧边框宽度 Thin|medium|thick|length
Border-width 一次定义宽度 Thin|medium|thick|length
Border-color 设置边框颜色 Color
Border-style 设置边框样式 None|dotted|dash|solid等
Border-top 一次定义顶端 Border-top-width|color等
Border-right 一次定义右侧 Border-top-width|color等
Border-bottom 一次定义底端 Border-top-width|color等
Border-left 一次定义左侧 Border-top-width|color等
Width 定义宽度属性 Length|percentage|auto
Height 定义高度属性 Length|auto
Float 文字环绕 Left|right|none
Clear 哪一边环绕 Left|right|none|both
分级属性
Display 定义是否显示 Block、inline、list-item、none
White-space 怎样处理空白 Normal、pre、nowrap
List-style-type 加项目编号 Disc、circle、square等
List-style-image 加图案 <url>|none
List-style-position 第二行起始位置 Inside、outside
List-style 一次定义列表 <keyword>|<position>|<url>
鼠标 ( Cursor ) 属性
Auto 自动
Crosshair 定位“十”字
Default 默认指针
Hand 手形
Move 移动
e-resize 箭头朝右方
Ne-resize 箭头朝右上方
Nw-resize 箭头朝左上方
n-resize 箭头朝上方
Se-resize 箭头朝右下方
Sw-resize 箭头朝左下方
s-resize 箭头朝下方
w-resize 箭头朝左方
Text 文本“I”形
Wait 等待
Help 帮助
背景层自适应高度
Wednesday, September 12th, 20071
<div style=”overflow:hidden; _height:1%; border:1px#333 solid; width:600px; margin:auto;”>
<div style=”width:300px; float:left; height:100px; background:#f60;”></div>
<div style=”width:300px; float:left; height:300px; background:#ccc;”></div>
</div>
2
<div class=”m clear”>
<div>左</div>
<div>右</div>
</div>
.clear:after {
content: “.”;
display: block;
height: 0;
clear: both;
visibility: hidden;
}
关于after可以参考:http://www.blueidea.com/tech/web/2005/3065.asp
ie6不能设背景图片最小高度的bug
Wednesday, June 27th, 2007刚刚遇到一个问题,在设定一个div的背景图片的时候不能设定最小高度,只是在ie6下才有这个问题,在ie7和ff下都没有这个问题,无论我设多高都好,背景图片总是在repeat,开始以为是repeat的问题,设了 background-repeat: no-repeat; ,但还是不行,最后只有Google.com了,不过网上好像没有相关的问题,难道是我的问题。问了朋友才知道,原来是font-size的问题,只要把font-size设小一点就行了,以后遇到图片高度很小的时候,记得要把font-size设小一点,不然背景就会一直repeat。