第一步:建立工作区间
首先,我们要位我们这个教程建立一个工作区间,建立如图所示的文件层次结构,以及新建相应的空文件。

<!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 runat=”server”>
<title></title>
<script src=”Scripts/jquery-1.4.1.min.js” type=”text/javascript”></script>
<link href=”resources/css/style.css” rel=”stylesheet” type=”text/css” />
<link href=”resources/js/imageCrop/jquery.imagecrop.css” rel=”stylesheet” type=”text/css” />
<script src=”resources/js/imageCrop/jquery.imagecrop.js” type=”text/javascript”></script>
</head>
<body>
<form id=”form1″ runat=”server”>
<div id=”wrapper”>
<h1>
Jquery Image Croping plug-in</h1>
<div class=”image-decorator”>
<img alt=”Jquery Image Croping plug-in” height=”360px” id=”example” src=”resources/images/example.JPG”
width=”480″ /></div><!–图片修饰层–>
</div><!–#包裹层 –>
</form>
</body>
</html>
[/code]
style.css
* {
margin : 0;
outline : 0;
padding : 0;
}
/*初始化网页样式*/
body {
background-color : #ededed;
color : #646464;
font-family : ‘Verdana’, ‘Geneva’, sans-serif;
font-size : 12px;
text-shadow : 0 1px 0 #ffffff;
}
h1 {
font-size : 24px;
font-weight : normal;
margin : 0 0 10px 0;
}
div#wrapper {
margin : 25px 25px 25px 25px;
}
/*选择id为wrapper的div*/
div.image-decorator {
-moz-border-radius : 5px 5px 5px 5px;/*针对火狐的浏览器的盒子的锐化*/
-moz-box-shadow : 0 0 6px #c8c8c8;/*针对火狐的浏览器的盒子的边框阴影处理*/
-webkit-border-radius : 5px 5px 5px 5px;/*WebKit 是一个开源的浏览器引擎*/
-webkit-box-shadow : 0 0 6px #c8c8c8;
background-color : #ffffff;
border : 1px solid #c8c8c8;
border-radius : 5px 5px 5px 5px;
box-shadow : 0 0 6px #c8c8c8;
display : inline-block;/*将对象呈递为内联对象,但是对象的内容作为块对象呈递。旁边的内联对象会被呈递在同一行内,允许空格。支持的浏览器有:Opera、Safari*/
height : 360px;
padding : 5px 5px 5px 5px;
width : 480px;
}
以上我们通过改变背景颜色和设置一些基本的样式,使我们的页面更具有可观赏性。










