单纯的背景色渐变: background: -webkit-gradient(linear, 0 0, 0 100%, color-stop(0, #fff), color-stop(1, #ddd)); background: linear-gradient(to bottom, #fff 0px, #ddd 100%) repeat scroll 0% 0%; 可以同时支持谷歌.火狐浏览器,兼容性比较强. 背景图的位置: background:url("images/taocan-bg.pn…
一.段落样式 css中关于段落的样式主要有行高,缩进,段落对齐,文字间距,文字溢出,段落换行等.它们的具体语法如下: line-height : normal | length text-indent : length text-align : left | right | center | justify letter-spacing : normal | length text-overflow:clip | ellipsis word-wrap:normal | break-word 其中…
body { /* 加载背景图 */ background-image: url(images/background-photo.jpg); /* 背景图垂直.水平均居中 */ background-position: center center; /* 背景图不平铺 */ background-repeat: no-repeat; /* 当内容高度大于图片高度时,背景图像的位置相对于viewport固定 */ background-attachment: fixed; /* 让背景图基于容器大…
在div中设置背景色:当border宽度很大时就要考虑一个问题,那就是背景的作用范围,是包括边框呢?还是不包括呢?很明显,又到浏览器产生分歧的时候了. 在IE中背景色的作用范围为:content+padding.而谷歌,火狐为content+padding+border.很明显,IE中的背景色范围是"局限"在边框内的,而谷歌,火狐则包括边框. 如代码: <html> <head> <title></title> <style>…
Label 背景图自动缩放 QPixmap* pixmap = new QPixmap(":/images/HeadIcon/1.png"); pixmap->scaled(ui->label->size(),Qt::KeepAspectRatio); ui->label->setScaledContents(true); ui->label->setPixmap(*pixmap); PushButton 背景图自动缩放 ui->push…
 [原链接]http://www.2cto.com/kf/201310/248187.html <style type="text/css">     .linear{            width:100%;            height:600px;            FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#b8c4cb,endColo…
本文转载自:http://blog.csdn.net/gingerredjade/article/details/12191741 <style type="text/css"> .linear{ width:100%; height:600px; FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#b8c4cb,endColorStr=#f6f6f8); /*IE…
div{ width: 200px; height: 200px; FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=, startColorStr=#AC07BD, endColorStr=#f6f6f8); /*IE 6 7 8*/ background: -ms-linear-gradient(top, #AC07BD, #f6f6f8); /* IE 10 */ background:-moz-linear-g…
第一步:配置文件web.config里添加 <system.web><connectionStrings> <!--name 是自定义的,connectionString 的值是你存放图片的虚拟路径--><add name="strCon" connectionString="~/Image"/></connectionStrings></system.web> 第二步:aspx页面<he…
我们都知道background-position属性用来指定背景图片应该出现的位置,可以使用关键字.绝对值和相对值进行指定.在CSS Sprites中,这个属性使用比较频繁,使用过程中,我常混淆,经常切不到自己想要的效果,于是决定好好理解其工作机制,这篇文章就是介绍background-position属性是如何指定背景图片和背景区域的位置关系. 注意:segmentfault对CodePen嵌入支持度不是很好,为使文章整洁,我将嵌入代码全部删除,完整体验请猛戳此处! background-po…