Skip to content

Instantly share code, notes, and snippets.

@RhinoLu
Created January 22, 2013 01:45
Show Gist options
  • Select an option

  • Save RhinoLu/4591337 to your computer and use it in GitHub Desktop.

Select an option

Save RhinoLu/4591337 to your computer and use it in GitHub Desktop.
html 上下左右置中
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title></title>
<style type="text/css">
html, body { height:100%; }
body { margin:0; padding:0; overflow:hidden; text-align:left; background-color: #222; }
object:focus { outline:none; }
#container {
position: absolute;
left: 50%;
top: 50%;
width: 960px;
height: 540px;
margin-left: -480px;
margin-top: -270px;
background-color: #333;
border:1px solid #000;
padding:1px;
}
</style>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
swfobject.embedSWF("Main.swf", "flashContent", "960", "540", "11.5.0", "",
{}, // FlashVars
{bgcolor: "#000000", allowscriptaccess : "always", allowfullscreen : "true", wmode :"direct"}, // Params
{id : "flashObj", name : "flashObj"}); // Attribute
</script>
</head>
<body>
<div id="container">
<div id="flashContent">
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment