我在调整 JSP 代码的输出时遇到一些问题 它看起来像 this 我希望它以一种很好的方式格式化,但我不知道该怎么做
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Weather Manager</title>
</head>
<body>
<div align="left">
<form action=/Orange_assignment/Login>
Email : <input type="text" name="Email" align="left"> <br>
Password: <input type="text" name="Password" align="left"> <br>
<button type="submit" align="left"> Login!</button>
Login using your credentials
</form>
<form action='Signup.jsp' method=POST>
<button type="submit">Signup!</button>
Not a user? Signup!
<pre> <img src="OrangeTM.jpg" alt="Orange Logo"
style="width: 50px; height: 50px">
</pre>
</form>
</div>
</body>
</html>
最佳答案
继之前的答案之后,使用表格进行布局被认为是不好的做法( Why not use tables for layout in HTML? ),但我想我们都已经这样做了(无论如何我们都是非设计师)。然而,随着 Twitter Bootstrap 库的出现,我们现在都可以制作漂亮的表单*:
http://getbootstrap.com/css/#forms-horizontal
- 设计师不得同意此观点。
关于java - JSP中如何对齐元素的输出?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26491986/