功能:1.图片可以缩放,外框也随之变动。2.图片缩放后,居底对齐。3.鼠标滑上去,边框有虚线。结构:源代码: 相册自适应写法 /* ================================================================== general xhtml 1.0 - Main style sheet - liquid design 2007-05-18 Author - ouhee Backa made by 相册自适应写法 ================================================================== */ * {margin:0px;padding:0px;font-size:12px;list-style:none;float:none;font-weight:normal; color:#727272;} html,body {height:100%;background:#fff;} body {text-align:center;margin:0px;padding:0px;background:#fff;} body > div{text-align:center; margin-right:auto; margin-left:auto;text-align:left;} div,form,img,a img,ul,ol,li,dl,dt,dd{border:0px; text-align:left;} h1,h2,h3,h4,h5,h6,p{text-align:left;} table,td,tr,th,br{font-size:12px;} img{vertical-align:middle;} strong{font-weight:bold;} .clear {clear: both;overflow: hidden;width: 1px;height: 1px;margin: 0px -1px -1px 0px;border: 0px;padding: 0px;font-size: 0px;line-height: 0px;} a{font-size:12px;color:#2d94ff;} a:link{text-decoration:underline;} a:visited{text-decoration:underline;} a:hover{text-decoration:none;color:#fe7bb9;} .sideBlock{float:left;width:150px;height:150x;padding:10px 0px;text-align:center;border:1px solid #fff;margin:10px;} .sideBlock p{height:24px;line-height:24px;text-align:center;} .sideBlock table{margin-bottom:3px;margin:0px auto;} .sideBlock table td{height:125px;} .sideBlock .t2{background:url(http://hiphotos.baidu.com/ouhee/pic/item/ce38fdcdfae7c9540eb34552.jpg) repeat-x right top;} .sideBlock .b2{background:url(http://hiphotos.baidu.com/ouhee/pic/item/2c0860cbea2ba51abf09e652.jpg) repeat-x right bottom;} .sideBlock .t1{height:6px;font-size:6px;} .sideBlock .m1{background:url(http://hiphotos.baidu.com/ouhee/pic/item/800911461372e90c6a63e552.jpg) repeat-y #fff;} .sideBlock .m2{background:url(http://hiphotos.baidu.com/ouhee/pic/item/6ce9cf074a94b1c87a894752.jpg) repeat-y top right;padding:2px 9px 3px 20px;} .sideBlock .m2 img{vertical-align:top;} .sideBlock .b1{height:7px;font-size:4px;} .sideBlock .b1 img{vertical-align:top!important;vertical-align/* */:bottom;} .borderColor{border:1px dashed #000;}/*边框滑动过颜色*/ .borderColorNone{border:1px solid #fff;}/*边框滑动后的颜色*/ function g_b_ccn(obj, addClass, delClass) { var addReg = new RegExp("\\b" + addClass + "\\b"); var delReg = new RegExp("\\b" + delClass + "\\b"); obj.className = obj.className.replace(delReg, ''); if (!obj.className.match(addReg)) { if (obj.className != "") obj.className += (" "+addClass); else obj.className += addClass; } } 底部底部边边 底部底部边边 底部底部边边 [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]