易截截图软件、单文件、免安装、纯绿色、仅160KB

CSS IE6+、FF兼容 图片大小自适应

CSS代码如下:
img { /*-- 专门用于限定文章DIV下的图片 --*/
max-width: 680px;
max-height: 700px;
}
*html img { /*兼容IE6*/
width: expression(this.width > 700 && this.width > this.height ? 680 : true);
height: expression(this.height > 700 || this.height > this.width ? 700 : true);
}


相关文档:

CSS和JS标签style属性对照表


盒子标签和属性对照
CSS语法(不区分大小写)
JavaScript语法(区分大小写)
border
border
border-bottom
borderBottom
border-bottom-color
borderBottomColor
border-bottom-style
borderBottomStyle
border-bottom-width
borderBottomWidth
border-color
borderColor
border-left
borderLeft
border ......

5个CSS书写技巧

1. CSS Reset/重置
你也许需要先了解什么是css重置。然后怎么样写css重置呢。
你可以copy Eric Meyer Reset, YUI Reset或其它css reset, 但你接下来应该根据你的项目改成你自己的reset.
不要使用* { margin: 0; padding: 0; } 。我个人很爱用,原作者提到使用这句并不适用一些元素比如单选按钮。不过俺博客里面也没有单 ......

用css让图片自动适应大小

图片自动适应大小的问题在平时制作的时候是比较常见的问题,下面提供一个比较简单的解决方法:
div img {
max-width:600px;
//IE7、FF等其他非IE浏览器下最大宽度为600px;
width:600px;
//所有浏览器中图片的大小为600px;
width:expression(document.body.clientWidth>600?"600px":"auto");
//当图片大小大于6 ......

JS+CSS漂亮相册效果

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JS+CSS相册展示&l ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号