css

来源:互联网 发布:genbank数据库记录 编辑:程序博客网 时间:2024/06/01 09:16
   <pre name="code" class="html">.note {    background: url("../images/note.gif") no-repeat scroll 10px 10px #fffdee;    border: 1px solid #f00;    border-radius: 5px;    color: #666;    font-size: 12px;    font-weight: normal;    line-height: 24px;    margin: 20px auto 0;    overflow: hidden;    padding: 8px 10px 8px 40px;    text-align: left;    width: 400px;}

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

图片按比例自动缩放

按比例缩小或者放大到某个尺寸,对于标准浏览器(如Firefox),或者最新都IE7浏览器,直接使用max-width,max-height;或者min-width,min-height的CSS属性即可。如:img{max-width:100px;max-height:100px;}img{min-width:100px;min-height:100px;}对于IE6及其以下版本的浏览器,则可以利用其支持的expression属性,在css code中嵌入javascript code来实现图片的缩放.thumbImage {max-width: 100px;max-height: 100px;} /* for Firefox & IE7 */* html .thumbImage { /* for IE6 */width: expression(this.width > 100 && this.width > this.height ? 100 : auto);height: expression(this.height > 100 ? 100 : auto);}


                                             
0 0