<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default"%>
<%@ OutputCache Duration="3600" VaryByParam="none" Location="Server"%><!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">
<title>美食网</title></head>
<body style="padding-right: 0px; padding-left: 0px; margin-left: 0px; margin-right: 0px;">
<form id="form1" runat="server" >
<asp:Image ID="Image1" runat="server" EnableViewState="false" Height="66px" Style="z-index: 100; left: -14px;
position: absolute; top: -6px" Width="1130px" ImageUrl="~/image/biaoti.jpg" />
<%@ OutputCache Duration="3600" VaryByParam="none" Location="Server"%><!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">
<title>美食网</title></head>
<body style="padding-right: 0px; padding-left: 0px; margin-left: 0px; margin-right: 0px;">
<form id="form1" runat="server" >
<asp:Image ID="Image1" runat="server" EnableViewState="false" Height="66px" Style="z-index: 100; left: -14px;
position: absolute; top: -6px" Width="1130px" ImageUrl="~/image/biaoti.jpg" />
-------------------------------
用padding 不好掌握位置。
不如
<body style="text-align:center;">
<center>
<form id="form1">
<div id="wrapper">
<h1>jQuery Playground</h1>
<ul id="nav">
<li><a class="current" href="Default.aspx">Test Page</a></li>
<li><a href="#">About</a></li>
</ul>
<div id="content">
<h2>Welcome!</h2>
<p><input id="clickme" type="submit" value="请单击我!" /></p>
</div>
<div id="foot">Powered By Charlie Zhuo.</div>
<div class="error">用户名不存在!</div>
<p class="error">邮箱格式不正确!</p>
</div>
</form>
</center>
</body>
<form id="form1" runat="server" >
<asp:Image ID="Image1" runat="server" EnableViewState="false" Height="66px" Style="margin:0 auto;" Width="1130px" ImageUrl="~/image/biaoti.jpg" /> 试试
<body>
<center>内容</center>
</body>
参考这个
<asp:DataList ID="DataList4" runat="server" EnableViewState="False" BackColor="White" BorderColor="#FF8000" CellPadding="5" RepeatColumns="3" Style="z-index: 119; left: 448px; position: absolute;
top: 336px; text-align: left;"
与控件没关系,你把所有body里面的内容外面加一个<DIV style="text-algin:center;">页面内容</DIV>
<!--
#form1 {
padding: 0px;
width: 800px;
margin-top: 0px;
margin-right: auto;
margin-bottom: 0px;
margin-left: auto;
}
-->
</style>
<body>
<div class="cCenter">
剧中了
</div>
</body>
样式:
body{text-align:center};
.cCenter{margin:0 auto;}
就可以了
<asp:Image ID="Image1" runat="server" EnableViewState="false" Height="66px" Style="z-index: 100; left: -14px; position: absolute; top: -6px" Width="1130px" ImageUrl="~/image/biaoti.jpg" />该image因为使用了 position: absolute,left: -14px; top: -6px"是相对于页面左上角的绝对坐标层。需要把删除Style,就可以了。