---
title: "div上下左右居中"
author: "shixiuteng"
date: "2012-04-28T11:22:04Z"
tags: []
categories: ["Web前端"]
slug: "div"
draft: false
lastmod: "2012-04-28T11:22:04Z"
id: 1503238
url: "https://itzyx.iteye.com/blog/1503238"
---

```
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
     <title>win_center</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
  <style type="text/css">
html,body{width:100%;height:100%;padding:0;margin:0;overflow:auto;}
.wrap{
       height:100%;
       text-align:center;
}
.container {
       width:200px;
       border:0px solid #ccc;
       text-align:left;
       display:inline-block;
       vertical-align:middle;
}
.edge {
     width:1px;
     *width:0;
      height:100%;
      display:inline-block;
      vertical-align:middle;
}
</style>
</head>
<body>
   <div class="wrap">
	<span class="edge"></span>
	<span class="container">
		<img src="/infobidding/img/win_center.jpg" width="550" height="330" border="0">
	</span>
	</div>
</body>
  
</html>
```