---
title: "图片尺寸过大时会撑开页面解决方法"
author: "chanball"
date: "2010-08-18T14:44:46Z"
tags: []
categories: ["Web前端"]
slug: "untitled"
draft: false
lastmod: "2010-08-18T14:46:01Z"
id: 740170
url: "https://javaExtjs.iteye.com/blog/740170"
---

```css

/* 防止img过大撑开 */
img{
	max-width:1002px;/* Other */
	_width:expression((this.offsetWidth > 1002) ? "1002px" : this.offsetWidth+"px" );/* IE */
}

```