<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link href="StyleSheet.css" rel="stylesheet" type="text/css" />
<script src="jquery.js" type="text/javascript"></script>
<script type="text/javascript">
function ShowMessageBox() {
var _width = document.documentElement.clientWidth;
var _height = document.documentElement.clientHeight;
$("#div_msg").css("top", (_height-$("#div_msg").height())/ 2);
$("#div_msg").css("left", (_width- $("#div_msg").width())/2);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<a href="javascript:void(0)" onclick="ShowMessageBox()" >Click</a>
<div id="div_msg" class="div_msg" style="position:absolute;left:0;top:0;width:250px">
保存成功!
</div>
</div>
</form>
</body>
</html>
上面用到jQuery,你可以改成普通的实现。