jsp页面整体靠左边,无法居中

jsp页面整体靠左边,无法居中,第1张

我知道这个问题,在开头这么写就可以了
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 10 Transitional//EN" "><td colspan="8" align="center" valign="middle" style="color:red;vertical-align:middle;"><h3>未接受处理机动车目录</h3></td>
不过你为什么要多余价格 H3标签

一般登录框使用fieldset做的:
<form name="myform">
<fieldset>
<legend>登录</legend>
价格:
<input type="text" name="bookprice" value="50"><br/>
书名:
<input type="text" name="bookname" value="Javascript入门教程"><br/>
作者:
<input type="text" name="bookauthor" value="小明"><br/>
<input type="button" onclick="getPrice()" value="计算折扣价">
</fieldset>
</form>
直接对fieldset元素用以下样式即可:
<style type="text/css">
fieldset {
margin:0px auto;
width:300px;
}
</style>

文字放在另一个div中,控制该div的margin-top
<div id="div" style="width:100px; height:100px; border:1px solid #000;">
<div style="margin-top:82px;text-align: center;">
文字靠下居中
</div>
</div>

<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>标签结构破坏了


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/13407649.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-07-30
下一篇 2023-07-30

发表评论

登录后才能评论

评论列表(0条)

保存