<div align="center">
<form action="DengluServlet" method="post" style="padding-top:-700px;">
用户名:<input type="text" name="name" value=""><br>
密 码:<input type="password" name="pwd" value=""><br>
<input type="submit" value="登录" name="denglu"><input type="reset" value="重置"><br>
</form>
</div>
在表单外面加个div 设置 align属性: center
<div style="margin:0px auto; width:900px;"></div>如果不行也可以这样<style type="text/css">body{text-align:center;}#main{width:900px; text-algin:left; margin:0px auto;}</style><body><div id="main"></div></body>再不可以,就是你的jsp服务器代码有问题,把<html>标签结构破坏了
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>鼓楼-清河坊</title>
</head>
<frameset cols="1120,320" name="m_wap" id="m_wap" frameborder="no" border="0" framespacing="0" style="width:1440px; height:900px; margin:0 auto;">
<frame src="part_four_1html" name="mainFrame" id="mainFrame" title="mainFrame" />
<frame src="part_four_r1html" name="rightFrame" scrolling="No" noresize="noresize" id="rightFrame" title="rightFrame" />
</frameset>
<noframes><body>
</body></noframes>
</html>
项目的整体显示的宽度是1440宽,高为900。这里设定了整体大框架的一个宽高以及大框架的一个整体的居中(用margin:0 auto来设定),以及左右两个框架的宽度(左1120,右320),这样就能实现整体框架的居中显示了。
另外,要实现点击左侧框架的链接改变右侧(左侧)框架的文件,链接写法如下:
<a href="#" target="mainFrame"></a>
其中,mainFrame为右侧(左侧)框架的id名
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)