위로 아래

글작성 페이지 HTML 태그 작성

 

기본적으로 View는 HTML이 아닌 JSP 파일을 이용한다.

가장 먼저 기본이 되는 글작성 JSP의 HTML 태그 부분을 작성.

 

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>글 작성</title>
</head>
<body>
<form name="form1" method="post" action="">
<table>
	<tr><td colspan="2"><h3>게시글 쓰기</h3></td></tr>
	<tr>
		<th>제목</th>
		<td><input type="text" name="subject"></td>
	</tr>
	<tr>
		<th>작성자</th>
		<td><input type="text" name="writer"></td>
	</tr>
	<tr>
		<th>글 내용</th>
		<td><textarea name="content"></textarea></td>
	</tr>
	<tr>
		<th>비밀번호</th>
		<td><input type="password" name="passwd"></td>
	</tr>
	<tr>
		<td colspan="2">
			<input class="btn" type="button" value="글 저장" id="submit11">
			<input class="btn" type="button" value="글 목록" onclick="">
		</td>
	</tr>
</table>
</form>
</body>
</html>

 

 

글작성 페이지 CSS 작성

 

css폴더에 Form.css 파일을 만들어 css 작성

@charset "UTF-8";

* {margin:0; padding:0;}

body{ width:100%; background-color: #f6f6ee;}
table {
	width:70%;
	margin: 0 auto;
	padding:10px;
	border-radius:25px;
}

table th {
	border : 1px solid balck;
}

table tr {text-align:center;}

table th {
	text-align:center;
	background-color : #ffffff;
	border-radius:10px;
}

input {width:90%; padding:3px;}

textarea {
	width:90%; height:300px; padding:3px;
	resize: none;	
}

.btn {width:100px; margin-top:5px; margin-bottom:10px;}

h3 {margin:5px 5px 10px 5px;}

 

 

 


전체 코드

더보기
<!-- BoardWriteForm.jsp -->
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>글 작성</title>
<link rel="stylesheet" type="text/css" href="css/Form.css">
</script>
</head>
<body>
<form name="form1" method="post" action="">
<table>
	<tr><td colspan="2"><h3>게시글 쓰기</h3></td></tr>
	<tr>
		<th>제목</th>
		<td><input type="text" name="subject"></td>
		
	</tr>
	<tr>
		<th>작성자</th>
	<td><input type="text" name="writer"></td>
	</tr>
	<tr>
		<th>글 내용</th>
		<td><textarea name="content"></textarea></td>
	</tr>
	<tr>
		<th>비밀번호</th>
		<td><input type="password" name="passwd"></td>
	</tr>
	<tr>
		<td colspan="2">
			<input class="btn" type="button" value="글 저장" id="submit11">
			<input class="btn" type="button" value="글 목록" onclick="">
		</td>
	</tr>
</table>
</form>
</body>
</html>
/* Form.css */
@charset "UTF-8";

* {margin:0; padding:0;}

body{ width:100%; background-color: #f6f6ee;}
table {
	width:70%;
	margin: 0 auto;
	padding:10px;
	border-radius:25px;
}

table th {
	border : 1px solid balck;
}

table tr {text-align:center;}

table th {
	text-align:center;
	background-color : #ffffff;
	border-radius:10px;
}

input {width:90%; padding:3px;}

textarea {
	width:90%; height:300px; padding:3px;
	resize: none;	
}

.btn {width:100px; margin-top:5px; margin-bottom:10px;}

h3 {margin:5px 5px 10px 5px;}