Css代码
Css代码
1.line-height:24px;
line-height:24px;
使用固定宽度的容器并且需要一行垂直居中时,使用 line-height 即可(高度与父层容器一致),更多的垂直居中总结可以看这里。
清除容器浮动
Css代码
1.#main {
2. overflow:hidden;
3.}
#main {
overflow:hidden;
}
期前也提到过这样的问题,更多信息可以看这里。
不让链接折行
Css代码
1.a {
2. white-space:nowrap;
3.}
a {
white-space:nowrap;
}
上面的设定就能避免链接折行,不过个人建议长链接会有相应的这行(有关换行方面的讨论,参看圆心的记录)。
始终让 Firefox 显示滚动条
Css代码
1.html {
2. overflow:-moz-scrollbars-vertical;
3.}
html {
overflow:-moz-scrollbars-vertical;
}
更多的 Mozilla/Firefox 私有 CSS 属性可以参考这里。需跨浏览器的支持,也可以使用
Css代码
1.body, html {
2. min-height:101%;
3.}
body, html {
min-height:101%;
}
使块元素水平居中
Css代码
1.margin:0 auto;
margin:0 auto;
其实就是
Css代码
1.margin-left: auto;
2.margin-right: auto;
margin-left: auto;
margin-right: auto;
这个技巧基本上所有的 CSS 教科书都会有说明,别忘记给它加上个宽度。Exploer 下也可以使用
Css代码
1.body{
2. text-align: center;
3.}
body{
text-align: center;
}
然后定义内层容器
Css代码
1.text-align: left;
text-align: left;
恢复。
隐藏 Exploer textarea 的滚动条
Css代码
1.textarea {
2. overflow:auto;
3.}
textarea {
overflow:auto;
}
Exploer 默认情况下 textarea 会有垂直滚动条(不要问我为什么)。
设置打印分页
Css代码
1.h2 {
2. &nb
相关文档:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<TITLE>无刷新变换样式表</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" /& ......
1.全部的代码均在一个DIV容器(我暂时这样称呼) Head里面,我们来看看Head的写法
#Head{
text-align:center;
}
为什么Head前面有一个"#"号呢?
而有的却是在前面加一个"."比如 ".Head",有时候写css的时候干脆什么也不加,比如 td,body,他们有什么区别,具体怎么用,如果仔细你就会发现在HTML ......
盒子标签和属性对照
CSS语法(不区分大小写)
JavaScript语法(区分大小写)
border
border
border-bottom
borderBottom
border-bottom-color
borderBottomColor
border-bottom-style
borderBottomStyle
border-bottom-width
borderBottomWidth
border-color
borderColor
border-left
borderLeft
border ......
<style type="text/css">
/*
从上往下渐变
*/
body
{
FILTER:progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#003C9F,endColorStr=white);
}
/*
从左上至右下渐变
*/
body
{
background-color:skyblue;
FILTE ......
姓名:乐乐---乐css-lecss
团队开发做的。本人负责的页面以及排版之类的,有兴趣的可以去网站上转悠转悠下。。
天堂网:
www.tiantang.cn
http://tiantang.cn/hills/hill1/page/hillindex.aspx
老人网:
www.laoren.cn
--
设计过程那是一种漫长而昂贵的折磨..。
--
我蛮喜欢CSS的,可是却也对它很烦恼,有 ......