---
title: "自适应窗口容器"
author: "master3003"
date: "2011-10-08T06:47:53Z"
tags: []
categories: ["Web前端"]
slug: "untitled"
draft: false
lastmod: "2011-10-08T06:47:53Z"
id: 1186514
url: "https://master3003.iteye.com/blog/1186514"
---

CSS自适应窗口大小的容器居中，在内层的容器中，你可以输入一些文字，内层窗口会随着窗口的大小而自动适应，而且它始终是水平和垂直居中的，实用性大大增强，对此感兴趣的朋友好好参考一下哦。
<html>
<head>
<style type="text/css">
*{margin:0; padding:0;}
html,body{width:100%; height:100%;overflow:hidden;}
body{margin:100px 0 0 100px;position:relative;}
.wrap{height:100%; width:100%; background:#ccc; position:absolute;
bottom:200px; right:200px;}
.cont{margin:200px 0 0 200px;}
</style>
</head>
<body>
<div class="wrap"><div class="cont">烈火学院（www.veryhuo.com）以提供计算机知识、网站运营、软件应用、设计教程、编程开发与IT资讯等为主要宗旨，同时有源码下载、站长工具、在线手册、免费资源等内容，是国内快捷易懂、内容丰富的网上学习网站。
</div></div>
</body>
</html><br /><center>如不能显示效果，请按Ctrl+F5刷新本页，更多网页代码：<a href='http://www.veryhuo.com/' target='_blank'>http://www.veryhuo.com/</a></center>