13种常用按钮、文本框、表单等CSS样式
2008-08-06 19:26:44 来源:WEB开发网 闂傚倸鍊搁崐鎼佸磹閹间礁纾归柟闂寸绾惧綊鏌熼梻瀵割槮缁炬儳缍婇弻鐔兼⒒鐎靛壊妲紒鐐劤缂嶅﹪寮婚悢鍏尖拻閻庨潧澹婂Σ顔剧磼閹冣挃闁硅櫕鎹囬垾鏃堝礃椤忎礁浜鹃柨婵嗙凹缁ㄧ粯銇勯幒瀣仾闁靛洤瀚伴獮鍥敍濮f寧鎹囬弻鐔哥瑹閸喖顬堝銈庡亝缁挸鐣烽崡鐐嶆棃鍩€椤掑嫮宓佸┑鐘插绾句粙鏌涚仦鎹愬闁逞屽墰閹虫捇锝炲┑瀣╅柍杞拌兌閻ゅ懐绱撴担鍓插剱妞ゆ垶鐟╁畷銉р偓锝庡枟閻撴洘銇勯幇闈涗簼缂佽埖姘ㄧ槐鎾诲礃閳哄倻顦板┑顔硷工椤嘲鐣烽幒鎴旀瀻闁规惌鍘借ⅵ濠电姷鏁告慨顓㈠磻閹剧粯鈷戞い鎺嗗亾缂佸鏁婚獮鍡涙倷閸濆嫮顔愬┑鐑囩秵閸撴瑦淇婇懖鈺冪<闁归偊鍙庡▓婊堟煛鐏炵硶鍋撻幇浣告倯闁硅偐琛ラ埀顒冨皺閺佹牕鈹戦悙鏉戠仸闁圭ǹ鎽滅划鏃堟偨缁嬭锕傛煕閺囥劌鐏犻柛鎰ㄥ亾婵$偑鍊栭崝锕€顭块埀顒佺箾瀹€濠侀偗婵﹨娅g槐鎺懳熺拠鑼舵暱闂備胶枪濞寸兘寮拠宸殨濠电姵纰嶉弲鎻掝熆鐠虹尨宸ョ€规挸妫濆铏圭磼濡搫顫嶇紓浣风劍閹稿啿鐣烽幋锕€绠婚悹鍥у级瀹撳秴顪冮妶鍡樺鞍缂佸鍨剁粋宥夋倷椤掍礁寮垮┑鈽嗗灣閸樠勭妤e啯鍊垫慨妯煎亾鐎氾拷

虽然CSS样式的学习需要我们动手多实践,需要多做案例,思致思考,但有时候注意资料的收集与整理也是非常重要的,在实际开发中往往会起到事半功倍的效果。
一、按钮样式
Example Source Code
.buttoncss {
font-family: "tahoma", "宋体";
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;
}
二、蓝色按钮
Example Source Code
.bluebuttoncss {
font-family: "tahoma", "宋体";
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 ;
}
三、红色按钮
Example Source Code
.redbuttoncss {
font-family: "tahoma", "宋体";
font-size: 9pt; color: #0066cc;
border: 1px #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/redbuttonbg.gif);
background-color: #ffffff;
cursor: hand;
font-style: normal ;
}
四、选择按钮
Example Source Code
.selectbuttoncss{
font-family: "tahoma", "宋体";
font-size: 9pt; color: #0066cc;
border: 1px #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 ;
}
五、绿色按钮
Example Source Code
.greenbuttoncss {
font-family: "tahoma", "宋体";
font-size: 9pt; color: #0066cc;
border: 1px #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/greenbuttonbg.gif);
background-color: #ffffff;
cursor: hand;
font-style: normal ;
}
六、图像按钮
Example Source Code
.imagebutton{
cursor: hand; /*改变鼠标形状 www.devdao.com*/
}
七、页面正文
Example Source Code
body {
scrollbar-face-color: #ededf3;
scrollbar-highlight-color: #ffffff;
scrollbar-shadow-color: #93949f;
scrollbar-3dlight-color: #ededf3;
scrollbar-arrow-color: #082468;
scrollbar-track-color: #f7f7f9;
scrollbar-darkshadow-color: #ededf3;
font-size: 9pt;
color: #003366;
overflow:auto;
}
Example Source Code
td { font-size: 12px }
th {
font-size: 12px;
}
八、下拉选择框
Example Source Code
select{
border-right: #000000 1px solid;
border-top: #ffffff 1px solid;
font-size: 12px;
border-left: #ffffff 1px solid;
color:#003366;
border-bottom: #000000 1px solid;
background-color: #f4f4f4;
}
九、线条文本编辑框
Example Source Code
.editbox{
background: #ffffff;
border: 1px solid #b7b7b7;
color: #003366;
cursor: text;
font-family: "arial";
font-size: 9pt;
height: 18px;
padding: 1px;
}
十、多行文本框
Example Source Code
.multieditbox{
background: #f8f8f8;
border-bottom: #b7b7b7 1px solid;
border-left: #b7b7b7 1px solid;
border-right: #b7b7b7 1px solid;
border-top: #b7b7b7 1px solid;
color: #000000;
cursor: text;
font-family: "arial";
font-size: 9pt;
padding: 1px;
}
十一、阴影风格的表单
Example Source Code
.shadow {
position:absolute;
z-index:1000;
top:0px;
left:0px;
background:gray;
background-color:#ffcc00;
filter : PRogidximagetransform.microsoft.dropshadow(color=#ff404040,offx=2,offy=2,positives=true);
}
十二、只显一条横线的输入框
Example Source Code
.logintxt{
border-right: #ffffff 0px solid;
border-top: #ffffff 0px solid;
font-size: 9pt;
border-left: #ffffff 0px solid;
border-bottom: #c0c0c0 1px solid;
background-color: #ffffff
}
十三、没有边框的输入框
Example Source Code
.noneinput{
text-align:center;
width:99%;height:99%;
border-top-style: none;
border-right-style: none;
border-left-style: none;
background-color: #f6f6f6;
border-bottom-style: none;
}
赞助商链接