CSS3中如何实现渐变效果

html-css017

CSS3中如何实现渐变效果,第1张

要得上面的线性渐变效果,我们这样去定义CSS3样式:background-image: -moz-linear-gradient(top, #8fa1ff, #3757fa)/* Firefox */background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #ff4f02), color-stop(1, #8f2c00))/* Saf4+, Chrome */filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#c6ff00', endColorstr='#538300', GradientType='0')/* IE*/-moz-linear-gradient有三个参数。第一个参数表示线性渐变的方向,top是从上到下、left是从左到右,如果定义成left top,那就是从左上角到右下角。第二个和第三个参数分别是起点颜色和终点颜色。你还可以在它们之间插入更多的参数,表示多种颜色的渐变。-webkit-gradient是webkit引擎对渐变的实现参数,一共有五个。第一个参数表示渐变类型(type),可以是linear(线性渐变)或者radial(径向渐变)。第二个参数和第三个参数,都是一对值,分别表示渐变起点和终点。这对值可以用坐标形式表示,也可以用关键值表示,比如 left top(左上角)和left bottom(左下角)。第四个和第五个参数,分别是两个color-stop函数。color-stop函数接受两个参数,第一个表示渐变的位置,0为起点,0.5为中点,1为结束点;第二个表示该点的颜色。IE依靠滤镜实现渐变。startColorstr表示起点的颜色,endColorstr表示终点颜色。GradientType表示渐变类型,0为缺省值,表示垂直渐变,1表示水平渐变。线性渐变使用from()以及to()方法指定过渡颜色点:background: -webkit-gradient(linear, left top, left bottom, from(#96ff00), color-stop(0.5, orange), to(rgb(255, 0, 0)))线性渐变多个过渡点在同一位置:background:-webkit-gradient(linear, left top, left bottom, from(#00abeb), to(#fff), color-stop(0.5, #fff), color-stop(0.5, #66cc00))径向渐变综合效果演示:

屏幕大小相差不是太大,就是机器越小,对散热的要求也就越大,性能也就稍微差一些,而且还比较贵。推荐13寸,或者14寸的。

可以考虑thinkpad x200 ht1,迅驰2的配置,12寸,没有光驱,也就8000,一年全国保修;x61也可以,就是显卡有些差,是集成的,价格7000到20000不等。

thinkpad x301,13寸绝对轻薄,光驱、摄像头功能齐全,固态硬盘,速度是一般硬盘的3倍,24000,三年全国联保;

thinkpad t61 1tc,8300左右,14寸宽屏,三年全国联保,加三年意外保护,就是配置是上一代的。

给你的模板吧,我一直在用的,算是收藏的了,你只要修改好图片就可以了。

至于图片显示的,就是支持外链的,校内网精品代码网上有推荐,校内网教程里,你去看看,用用哪个好,网址【www.xiaonw.cn】

body{background:#DEDDDB url(http://i.namipan.com/files/01c058df14d35836e11a4e0faf8ced27f2ffd7d4a41d000079f7/0/bg.jpg) repeat-y center top}

#opi .profile-panel{padding-top:303pxbackground:transparent url(http://imgsrc.baidu.com/css/pic/item/606d72cd8551994a0eb345ef.jpg) no-repeat center top}

#footer{background:transparent url(http://imgsrc.baidu.com/css/pic/item/0f38300f4722fcf6aa6457ef.jpg) no-repeat center bottompadding-bottom:146px}

#opi .box-header{background:transparent url(http://i.namipan.com/files/25a5878a2f0dc03791d95452079663c16a679a24e03900006d09/0/boxheader.jpg) no-repeat left centerpadding-left:20pxtext-indent:26pxheight:70pxwith:500pxline-height:74pxletter-spacing:1px}

#cmtbody{color:#6A3905height:113pxwidth:476pxborder:nonebackground:url(http://xn00.cn/cmtbody/cmtbody.jpg)padding:10px}

#commentPostBtn{background:url(http://i.namipan.com/files/5852337ab3239aee9461afc9201dd32ac28d2f44a80500003388/0/submit_btn_bg.gif)color:#7ecef4border:nonewidth:89pxheight:25pxmargin-left:30px}

.profile .tabs-wrapper{width:510pxborder-bottom:none}

.profile .profile-tabs{padding-left:120pxwidth:450px}

.profile .profile-tabs ul.tabs li.selected a.tab-link{background:nonecolor:#fff}

.profile .profile-tabs ul.tabs li a.tab-link{background:#FF8B1Ccolor:#fff}

.profile .profile-tabs ul.tabs li a.tab-link:hover{background:#567702}

.profile .profile-tabs ul.tabs li.selected{border:nonebackground:#E70600margin-top:-2px}

#footer .copyright{display:none} .profile .guide-find-friend{display:none}

#opi .left-column,#opi .profile-tabs-holder{margin-left:80px}

#opi .right-column{width:370pxposition:relativeleft:70px}

#opi .extra-column{margin-right:40px} #opi .feed-content{width:350px}

#opi .profile-tabs-holder{width:560px} #opi textarea{width:345px}

#opi .comment-holder .cmt-body{width:300px}

#opi .box,#opi .box-holder{border:0}

#opi .box-body,#opi .profile-summary,#opi .share{background:transparent}