我的Css是:
.div_big
{width:960px;float:left; padding:0px;margin-top:5px; margin-bottom:0px; margin-left:0 auto; margin-right:0 auto;}我只输入:
<div class="div_big" ><img src="../Picture/2688.gif" alt="" />
图片能居中,但我如果往顶部拖一个用户控件就是右对齐了,
代码变为:
<form id="form1" runat="server" style="text-align:center">
<uc1:top ID="Top1" runat="server" />
<div class="div_big" ><img src="../Picture/2688.gif" alt="" />
</div>
我的用户控件是用表做了.如果在一个页面中放用户控件,应该怎么样才能对齐啊?
.div_big
{width:960px;float:left; padding:0px;margin-top:5px; margin-bottom:0px; margin-left:0 auto; margin-right:0 auto;}我只输入:
<div class="div_big" ><img src="../Picture/2688.gif" alt="" />
图片能居中,但我如果往顶部拖一个用户控件就是右对齐了,
代码变为:
<form id="form1" runat="server" style="text-align:center">
<uc1:top ID="Top1" runat="server" />
<div class="div_big" ><img src="../Picture/2688.gif" alt="" />
</div>
我的用户控件是用表做了.如果在一个页面中放用户控件,应该怎么样才能对齐啊?
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>jQuery center plugin</title>
<script src="jquery.js" type="text/javascript"></script>
<script src="jquery.dimensions.js" type="text/javascript"></script>
<script src="jquery.center.js" type="text/javascript"></script>
<script src="functions.js" type="text/javascript"></script>
<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
</head>
<body>
<div id="all">
<h2>Center element plugin</h2>
<h3>Element</h3>
<div class="content">
<div class="centered">
<p>the content here will be centered</p>
</div>
</div>
<h3>Code</h3>
<div class="code">
<pre>
$("element").center();
</pre>
</div> <div class="content">
<div class="centered">
<p>the content here will be centered horizontally</p>
</div>
</div> <div class="code">
<pre>
$("element").center({ vertical: false; });
</pre>
</div> <div class="content">
<div class="centered">
<p>the content here will be centered vertically</p>
</div>
</div> <div class="code">
<pre>
$("element").center({ horizontal: false; });
</pre>
</div> </div>
<div id="footer">
Created by <a href="http://blog.alexandremagno.net" target="_blank">Alexandre Magno</a>
</div>
</body>
</html>