13种常用按钮、文本框、表单等CSS样式
虽然CSS样式的学习需要我们动手多实践,需要多做案例,思致思考,但有时候注意资料的收集与整理也是非常重要的,在实际开发中往往会起到事半功倍的效果。下面一些关于按钮、文本框、表单的常用CSS样式。大家可以参考。
一、按钮样式
.buttoncss {
font-family: "tahoma", "宋体"; /*www.52css.com*/
font-size:9pt; color: #003399;
border: 1px #003399 solid;
color:#006699;
border-bottom: #93bee2 1px solid;
border-left: #93bee2 1px solid;
border-right: #93bee2 1px solid;
border-top: #93bee2 1px solid;
background-image:url(../images/bluebuttonbg.gif);
background-color: #e8f4ff;
cursor: hand;
font-style: normal ;
width:60px;
height:22px;
}
二、蓝色按钮
.bluebuttoncss {
font-family: "tahoma", "宋体"; /*www.52css.com*/
font-size: 9pt; color: #003366;
border: 0px #93bee2 solid;
border-bottom: #93bee2 1px solid;
border-left: #93bee2 1px solid;
border-right: #93bee2 1px solid;
border-top: #93bee2 1px solid;*/
background-image:url(../images/blue_button_bg.gif);
background-color: #ffffff;
cursor: hand;
font-style: normal ;
}
三、红色按钮
.redbuttoncss {
font-family: "tahoma", "宋体"; /
相关文档:
一.使用css缩写
使用缩写可以帮助减少你CSS文件的大小,更加容易阅读。css缩写的主要规则请参看《常用css缩写语法总结》,这里就不展开描述。
二.明确定义单位,除非值为0
忘记定义尺寸的单位是CSS新手普遍的错误。在HTML中你可以只写width="100",但是在CSS中,你必须给一个准确的单位,比如:width: 100px width:100e ......
CSS代码如下:
img { /*-- 专门用于限定文章DIV下的图片 --*/
max-width: 680px;
max-height: 700px;
}
*html img { /*兼容IE6*/
width: expression(this.width > 700 && this.width > this.height ? 680 : tr ......
body{
background-image:url(about:blank);
background-attachment:fixed;
}
.myDiv{
position:fixed !important;
position:absolute;
top:expression(eval(document.documentElement.scrollTop));
}
body元素中background-image:url(about:blank);background-attachment:fixed;可防止ie6中出现闪 ......
例子:<span style="cursor:*">文本或其它页面元素</span> <a href="#" style="cursor:*">文本或其它页面元素</a> 注意把 * 换成如下15个效果的一种:
下面是对这15种效果的解释。移动鼠标到解释上面,看看你的鼠标起了什么变化吧!
hand是手型
例子:CSS鼠标手型效果 <a ......
竞争规则:css允许多次将同一个规则赋予某个元素。层叠排序根据规则中使用的选择符将规则划分6组,高优先级组里的规则会覆盖低优先级组里的规则。普通的选择符会设置文档的总体样式,更具体的选择符会覆盖普通选择符,以为其提供更加特殊的样式
6个选择符群组:
1. 使用!important规 ......