自己设计的第一个页面样式表,比较简陋~
#loginbox{
width: 300px;
padding: 30px;
margin: 100px auto;
background: lightgray;
border: 3px solid green;
}
#container{
width:"90%";
margin:0 auto;/*margin--边界,上下为0,左�自动*/
}
#header{
width:90%;
height:20px;
margin:0 auto;/*margin--边界,上下为0,左�自动*/
background:lightgray;
}
#middle{
width:90%;
height:600px;
margin:0 auto; /*margin--边界,上下为0,左�自动*/
overflow:hidden; /*防æ¢div被撑开,超过div大å°�å°±éš�è—�*/
background:white;
}
#menu{
width:15%;
height:600px;
float:left;
margin:0 auto; /*margin--边界,上下为0,左�自动*/
overflow:hidden; /*防æ¢div被撑开,超过div大å°�å°±éš�è—�*/
background: gray;
}
#main{
width:75%;
height:600px;
float:right;
margin:0 auto; /*margin--边界,上下为0,左�自动*/
overflow:hidden; /*防æ¢div被撑开,超过div大å°�å°±éš�è—�*/
background:white;
}
#footer{
width:90%;
height:20px;
margin:0 auto;/*margin--边界,上下为0,左�自动*/
background:lightgray;
}
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ page info="This is a text infomation"%>
<!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=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" href="./css/layout.css">
</head>
<body>
<div id="header" align="right">
<span><a href="<%=request.getContextPath() %>/toLogin.action">登录 </a></span>
<span> | </span>
<span><a href="<%=request.getContextPath() %>/toRegister.action"> 免费注册</a></span>
</div>
<div align="center" id="loginbox">
<s:form action="login" method="post" >
<s:textfield name="user.username" label="username"></s:textfield>
<s:password name="user.password" label="password"></s:password>
<s:submit></s:submit>
</s:form>
</div>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!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=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" href="./css/layout.css">
</head>
<body>
<div id="container">
<div id="header" align="right">
<span style="color:lightgreen">Welcome ${loginUser} </span>
<span> | </span>
<span><a href="<%=request.getContextPath() %>/logout.action">安全退出</a></span>
</div>
<div id="middle">
<div align="left" id="menu">
<br><br><br>
<a href="<%=request.getContextPath() %>/newPublishedProjects.action">最新项目</a><br>
<a href="<%=request.getContextPath() %>/newDealProjects.action">近期成交项目</a><br>
<a href="<%=request.getContextPath() %>/toPublishProjects.action">发布项目</a><br>
<a href="<%=request.getContextPath() %>/myPublishedProjects.action">我发布的所有项目</a><br>
<a href="<%=request.getContextPath() %>/myRequestProjects.action">我承接的所有项目</a><br>
</div>
<div align="left" id="main">
<span style="color:blue">最新项目 </span> <span style="color:gray">近期成交项目</span>
<table width="100%">
<tr><th width="30%">项目名称</th><th width="20%">啊十大</th><th width="10%">啊十大</th><th width="10%">阿萨</th><th width="30%">啊十大市场</th></tr>
<tr><td><a href="<%=request.getContextPath() %>/toRequest.action">pro1</a></td><td>1</td><td>1</td><td>1</td><td>1</td></tr>
<tr><td><a href="<%=request.getContextPath() %>/toRequest.action">pro1</a></td><td>2</td><td>2</td><td>2</td><td>2</td></tr>
</table>
</div>
</div>
<div id="footer" align="right">@copyright XXX company.</div>
</div>
</body>
</html>