1.css
<style type="text/css">
<!--
#cao {
}
body,td,th {
}
-->
</style>
<body>
<div id="cao">CAO888</div>
</body>
2.js:
<style type="text/css">
<!--
#cao {
}
body,td,th {
}
-->
</style>
<script language=javas
function changeIt() {
var myobj=document.getElementByIdx("cao");
var bodyhh=document.body.clientHeight;
var bodyww=document.body.clientWidth;
var objhh=myobj.clientHeight;
var objww=myobj.clientWidth;
myobj.style.top=(bodyhh-objhh)/2;
myobj.style.left=(bodyww-objww)/2;
}
</script>
<body on
<div id="cao">CAO888</div>
</body>
3.css右下角:
<style type="text/css">
</style>
<div id="div2" on
太强大了~
记下网址:http://www.sosuo8.com/article/show.asp?id=1578
完美示例:
<%@ Page Language="C#" CodeFile="DivTest.aspx.cs" Inherits="DivTest" %>
<!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">