'Front-End'에 해당되는 글 56건

  1. 2019.10.04 메인페이지 꾸며보기 (내 프로젝트에 적용)
  2. 2019.10.02 전체적으로 bootstrap 적용 (일부)
  3. 2019.10.02 로그인 폼에 bootstrap 적용
  4. 2019.10.02 메뉴바에 Bootstrap 적용
  5. 2019.10.01 두개의 영역(그림, 글자, 광고 등)을 나란히 놓기 - float:left/right 4
  6. 2019.09.27 Bootstrap 다운 및 스프링 프로젝트에 적용
  7. 2019.09.27 Bootstrap (부트스트랩) 이란??
  8. 2019.09.05 포토샵 강의

메인페이지 꾸며보기 (내 프로젝트에 적용)

Front-End/Bootstrap 2019. 10. 4. 17:19

메인페이지 home.jsp 페이지에 디자인을 추가한 글씨를 추가함


home.jsp


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>메인페이지</title>
<head>
 
 
  <!-- Required meta tags -->
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <!-- Bootstrap CSS -->
  <link href="/css/bootstrap.css" rel="stylesheet">
<header class="masthead">
<link href="/css/agency.css" rel="stylesheet">
 

- CSS 디자인 설정 -

 <style>
      d {
        font-family: "Arial Black", sans-serif;
        font-size: 45px;
        font-weight: bold;
        color: #ffffff;
      }
      .s3 { text-shadow: 6px 2px 2px gray; }
      
      
       c {
        font-family: "Arial Black", sans-serif;
        font-size: 45px;
        font-weight: bold;
        color: gren;
      }
      
      .s4 { text-shadow: 10px 4px 4px red; }
      
       p {
        margin: 20px;
        padding: 20px 0px;
        text-align: center;
        text-transform: uppercase;
        font-family: "Arial Black", sans-serif;
        font-size: 60px;
        font-weight: bold;
      }
      .s2 {
    
        color: #ffffff;
        text-shadow: 4px 4px 0px #bdbdbd;
      }
      
      
    </style>
  


   
  
    </head>
 
 
<%@ include file="include/header.jsp"%>
<%@ include file="include/menu.jsp"%>
 
<body background = "https://i.pinimg.com/originals/c6/4a/1d/c64a1d3ec620f0550c9211e83bbb0512.jpg">
<br>
<br>
 <Script src="/js/jquery-3.3.1.min.js"></script>
 <Script src="/js/bootstrap.min.js"></script>
 
<p class="s2">welcome to hs_project!!</p>
 
<div style="width: 60%; height:150px; float: right;">
    <center>
    
     <br><br><br><br><br>
    <d class="s3">We Create Value</d><br><br><br><br>
    <d class="s3">With You...</d><br><br><br><br>
    <d class="s3">Now is the time.</d><br><br><br><br>
    <c class="s4">Communicate and share with each other</c><br><br><br><br>
    
    </center>
</div>
 
<div style="width: 30%; height:150px; float: left;">
 
<%@ include file="include/login.jsp"%>
 
</div>
 
     
 
 
</body>
 
<!-- 로그인 실패나 성공시 메시지를 받아서 출력하는 자바스크립트 구문 -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script>
    $(function(){
        var responseMessage = "<c:out value="${message}" />";
        if (responseMessage != ""){
            alert(responseMessage)
        }
    })
</script>
 
 
<br>
<br>
 
 
</html>
cs




:

전체적으로 bootstrap 적용 (일부)

Front-End/Bootstrap 2019. 10. 2. 16:05


:

로그인 폼에 bootstrap 적용

Front-End/Bootstrap 2019. 10. 2. 16:03

로그인 폼에 bootstrap 적용해보기



login_form.jsp


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="google-signin-scope" content="profile email">
<meta name="google-signin-client_id" content="576736845363-o0474pib5q69qlcv6lm7o42hs6lu5u59.apps.googleusercontent.com">
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name = "viewport" content = "user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0,
width=device-width" />
 
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
 
<title>Insert title here</title>

//디자인을 설정하기위해 stylesheet 추가함
<link rel = "stylesheet" href = "/css/bootstrap.css">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
 
 
</head>
<br><br><%@ include file="../include/header.jsp"%>
 
<section>
 
<table border="1" width="300px" class = "table-hover">
 
 
        <div class="card align-middle" style="width:30rem; border-radius:20px;">
        
        <div class="card-body">
 
<!-- 로그인창 -->
<form action ="normale_login.do" method = "post">
<center>
<br>
<input type = "text" name="user_id" placeholder="  ID를 입력하세요 " class="form-control"><br><br>
<input type = "password" name="member_pass" placeholder="  비밀번호를 입력하세요 " class="form-control"><br><br>
<button type = "submit" name = "submit" class="form-control btn btn-primary">로그인</button>
<br>
<br>
</center>
 
<center>
 
<html lang="ko">
<head>
<script type="text/javascript" src="https://static.nid.naver.com/js/naveridlogin_js_sdk_2.0.0.js" width=200px, height=100px charset="utf-8"></script>
</head>
<body>
 
 
 
 
 
 
<br>
<!-- 네이버아이디로로그인 버튼 노출 영역 -->
<div id="naverIdLogin"></div>
<!-- //네이버 아이디로 로그인 버튼 노출 영역 -->
 
<!-- 네이버 아이디로 로그인 초기화 Script -->
<script type="text/javascript">
    var naverLogin = new naver.LoginWithNaverId(
        {
            //클라이언트 id와 콜백 url (결과페이지)
            clientId: "DphfmDygX4WFkf8nghMJ",
            callbackUrl: "http://localhost/hansub_project/login_result",
            isPopup: false/* 팝업을 통한 연동처리 여부 */
            loginButton: {color: "green", type: 3, height: 40/* 로그인 버튼의 타입을 지정 */
        }
    );
    
    /* 설정정보를 초기화하고 연동을 준비 */
    naverLogin.init();
    
</script>
</center>
 
 
</center>
 
<center>
<!-- 카카오톡 아이디 연동해서 로그인 -->
<script src = "//developers.kakao.com/sdk/js/kakao.min.js" width=200px, height=100px ></script>
<a id="kakao-login-btn"></a>
<a href="http://developers.kakao.com/logout"></a>
<script type='text/javascript'>
 
Kakao.init('bd21082a499aaa79b4c08e01935a8a70'); //아까 카카오개발자홈페이지에서 발급받은 자바스크립트 키를 입력함
 
//카카오 로그인 버튼을 생성합니다. 
 
Kakao.Auth.createLoginButton({ 
    container: '#kakao-login-btn'
    success: function(authObj) { 
           Kakao.API.request({
 
               url: '/v1/user/me',
 
               success: function(res) {
 
                     console.log(res.id);//<---- 콘솔 로그에 id 정보 출력(id는 res안에 있기 때문에  res.id 로 불러온다)
 
                     console.log(res.kaccount_email);//<---- 콘솔 로그에 email 정보 출력 (어딨는지 알겠죠?)
 
                     console.log(res.properties['nickname']);//<---- 콘솔 로그에 닉네임 출력(properties에 있는 nickname 접근 
                             
                 // res.properties.nickname으로도 접근 가능 )
                     console.log(authObj.access_token);//<---- 콘솔 로그에 토큰값 출력
          
          var id = res.id;    //카카오톡 닉네임을 변수에 저장
          var kakaonickname = res.properties.nickname;    //카카오톡 닉네임을 변수에 저장
          var kakaoe_mail = res.kaccount_email;    //카카오톡 이메일을 변수에 저장함
         
          
 
          window.location.replace("http://" + window.location.hostname + ( (location.port==""||location.port==undefined)?"":":" + location.port) + "/hansub_project/home?kakaonickname="+kakaonickname+"kakaotalk"+"&kakaoe_mail="+kakaoe_mail);
      
                   }
                 })
               },
               fail: function(error) {
                 alert(JSON.stringify(error));
               }
             });
</script>
</center>
 
 
<!-- 페이스북 아이디를 연동해서 로그인 -->
 
 <center>
<button type= "button" id= "loginBtn" ><img src="https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcQwsKoAUt9rmyFjqv055BANDSiVlqNsu-kOF2NKwpGzOgWFwiqD" width=200px, height=50px /></button>
 </center>
 
            <div id="access_token"></div>
            <div id="user_id"></div>
            <div id="name"></div>
            <div id="email"></div>
            <div id="gender"></div>
            <div id="birthday"></div>
            <div id="id"></div>            
            
<script>
function getUserData() {
    /* FB.api('/me', function(response) {
        document.getElementById('response').innerHTML = 'Hello ' + response.name;
        console.log(response);
    }); */
    FB.api('/me', {fields: 'name,email'}, function(response) {
        
        var facebookname = response.name;    //페이스북 아이디를 변수에 저장함
        var facebooke_mail = response.email;    //페이스북 이메일을 변수에 저장함
        
        
        window.location.replace("http://" + window.location.hostname + ( (location.port==""||location.port==undefined)?"":":" + location.port) + "/hansub_project/home?facebookname="+encodeURI(facebookname)+"&facebooke_mail="+facebooke_mail);
 
    });
}
  
window.fbAsyncInit = function() {
    //SDK loaded, initialize it
    FB.init({
        appId      : '488986078336253'//페이스북 개발자 홈페이지에서 앱을 등록하고, 앱 id를 받아온다.
        cookie     : true,  // enable cookies to allow the server to access
                // the session
        xfbml      : true,  // parse social plugins on this page
        version    : 'v3.3'     // 페이스북 개발자 홈페이지에서 버전을 확인한 후 작성한다.
    });
  
    //check user session and refresh it
    FB.getLoginStatus(function(response) {
        if (response.status === 'connected') {        //만약 정상적으로 실행되었다면 유저의 데이터를 가져온다.
            //user is authorized
            //document.getElementById('loginBtn').style.display = 'none';
            getUserData(); 
            
        
            
        } else {
            //user is not authorized
        }
    });
};
  
//load the JavaScript SDK
(function(d, s, id){
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) {return;}
    js = d.createElement(s); js.id = id;
    js.src = "//connect.facebook.com/ko_KR/sdk.js";
    fjs.parentNode.insertBefore(js, fjs);
}(document'script''facebook-jssdk'));
  
//add event listener to login button
document.getElementById('loginBtn').addEventListener('click'function() {
    //do the login
    FB.login(function(response) {
        if (response.authResponse) {
            access_token = response.authResponse.accessToken; //get access token
            user_id = response.authResponse.userID; //get FB UID
            console.log('access_token = '+access_token);
            console.log('user_id = '+user_id);
            //user just authorized your app
            //document.getElementById('loginBtn').style.display = 'none';
            getUserData();
        }
    }, {scope: 'email,public_profile,user_birthday',
        return_scopes: true});
}, false);
 
 
 
</script>
 
 
 
</form>
<br>
<!-- 아이디 찾기 -->
<!-- 위치를 왼쪽으로 고정시키고, 45퍼센트만큼 떨어짐 -->

<div style= "width:45%; float:left;">
<form action ="find.user_id.do">
<center>
<button class = "btn btn-default btn-block">아이디 찾기</button>
</center>
</form>
</div>
 
<!-- 비밀번호 찾기 -->
<!-- 위치를 오른쪽으로 고정시키고, 45퍼센트 만큼공간을 차지함. 두개의 버튼은 총 10퍼센트 만큼 떨어져 있는것. -->

<div style= "width:45%; float:right;">
<form action ="find.member_pass.do">
<center>
<button class = "btn btn-default btn-block">비밀번호 찾기</button>
<br>
</center>
</form>
<br>
</div>
<br>
 
</td>
<br>
</tr>
</div>
 
<br>
<br>
</div>
</div>
</div>
</table>
</section>
 
 
<body>
<!-- 로그인 실패나 성공시 메시지를 받아서 출력하는 자바스크립트 구문 -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script>
    $(function(){
        var responseMessage = "<c:out value="${message}" />";
        if (responseMessage != ""){
            alert(responseMessage)
        }
    })
</script>
 
 
</body>
</html>
cs




login.jsp (마찬가지로 버튼에 이미지를 적용함)


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<%@ include file="header.jsp"%>
 
 
<body>
<br>

<!-- 세션에 id값이 저장되어 있는 경우 로그아웃 버튼과 로그인한 아이디가 출력되도록 코드를 작성함 -->
 
<c:if test = "${sessionScope.user_id != null}">
 
<span style="color: black; font-weight: bold;">(일반)${sessionScope.user_id}님이 로그인 하셨습니다.</span><br><br>
 
<form action = "logout.do" method = "post">
<button type = "submit" name = "submit" class="btn btn-primary">로그아웃</button></form><br><br>
 
<form action = "member_profile.do" method = "post">
<button type = "submit" name = "submit" class = "btn btn-primary">나의 프로필 확인</button></form><br><br>
 
 
</c:if>
 
 
<c:if test = "${sessionScope.navername != null}">
 
<span style="color: black; font-weight: bold;">(네이버)${sessionScope.navername}님이 로그인 하셨습니다.</span><br><br>
 
<form action = "naver_logout.do" method = "post">
<button type = "submit" name = "submit" class="btn btn-primary">로그아웃</button></form><br><br>
 
<form action = "authentication.do" method = "post">
<button type = "submit" name = "submit" class = "btn btn-primary">회원 인증하기 (인증을 해야 각종 기능들 사용 가능)</button></form><br><br>
 
<form action = "naver_member_profile.do" method = "post">
<button type = "submit" name = "submit" class = "btn btn-primary">나의 프로필 확인</button></form><br><br>
 
</c:if>
 
 
<c:if test = "${sessionScope.kakaonickname != null}">
 
<span style="color: black; font-weight: bold;">(카카오톡)${sessionScope.kakaonickname}님이 로그인 하셨습니다.</span><br><br>
 
<form action = "kakao_logout.do" method = "post">
<button type = "submit" name = "submit" class="btn btn-primary">로그아웃</button></form><br><br>
 
<form action = "authentication.do" method = "post">
<button type = "submit" name = "submit" class = "btn btn-primary">회원 인증하기 (인증을 해야 각종 기능들 사용 가능)</button></form><br><br>
 
<form action = "kakao_member_profile.do" method = "post">
<button type = "submit" name = "submit" class = "btn btn-primary">나의 프로필 확인</button></form><br><br>
 
</c:if>
 
 
 
<c:if test = "${sessionScope.facebookname != null}">
 
<span style="color: black; font-weight: bold;">(페이스북)${sessionScope.facebookname}님이 로그인 하셨습니다.</span><br><br>
 
<form action = "facebook_logout.do" method = "post">
<button type = "submit" name = "submit" class="btn btn-primary">로그아웃</button></form><br><br>
 
 
<form action = "authentication.do" method = "post">
<button type = "submit" name = "submit" class = "btn btn-primary">회원 인증하기 (인증을 해야 각종 기능들 사용 가능)</button></form><br><br>
 
<form action = "facebook_member_profile.do" method = "post">
<button type = "submit" name = "submit" class = "btn btn-primary">나의 프로필 확인</button></form><br><br>
 
</c:if>
 
 
<c:if test = "${sessionScope.admin_id != null}">
 
<span style="color: black; font-weight: bold;">(관리자)${sessionScope.admin_id}님이 로그인 하셨습니다.</span><br><br>
 
<form action = "logout.do" method = "post">
<button type = "submit" name = "submit" class="btn btn-primary">로그아웃</button></form><br><br>
 
 
</c:if>
 
 
 
 
<c:if test = "${sessionScope.user_id == null and sessionScope.navername == null and sessionScope.kakaonickname == null and sessionScope.facebookname == null and sessionScope.admin_id == null}">
 
<%
//url로 보낸 아이디를 세션에 저장하기 위해 변수에 저장함
String navername = request.getParameter("navername");
String kakaonickname = request.getParameter("kakaonickname");
String facebookname = request.getParameter("facebookname");
String normalname = request.getParameter("user_id");
String admin_id = request.getParameter("admin_id");
 
 
//url로 보낸 이메일를 세션에 저장하기 위해 변수에 저장함
String navere_mail = request.getParameter("navere_mail");
String kakaoe_mail = request.getParameter("kakaoe_mail");
String facebooke_mail = request.getParameter("facebooke_mail");
 
%>    
 
 
<%
//아이디를 세션에 저장
session.setAttribute("navername", navername);
session.setAttribute("kakaonickname", kakaonickname);
session.setAttribute("facebookname", facebookname);
session.setAttribute("normalname", normalname);
session.setAttribute("admin_id", admin_id);
 
 
//이메일을 세션에 저장
session.setAttribute("navere_mail", navere_mail);
session.setAttribute("kakaoe_mail", kakaoe_mail);
session.setAttribute("facebooke_mail", facebooke_mail);
 
 
if (navername == null && kakaonickname == null && facebookname == null && normalname == null && admin_id == null) {
    
%>
 
<span style="color: black; font-weight: bold;">(guest)님 방문을 환영합니다.</span><br><br>
                                
                                
<span style="color: black; font-weight: bold;">로그인을 하셔야 다른 기능을 정상적으로 이용하실 수 있습니다.</span><br>
        
    <%@ include file="../member/login_form.jsp"%><br>
    
<%
 
    } 
 
%>
    
    
    </c:if>
 
</body>
</html>
cs






:

메뉴바에 Bootstrap 적용

Front-End/Bootstrap 2019. 10. 2. 15:44

메뉴바에 마우스를 올리면 해당 메뉴의 색깔이 변하면서 하위 메뉴를 출력하도록 설정함



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!-- views/include/menu.jsp -->
<%@ include file="header.jsp"%>
<head>

//디자인을 사용하기위해 bootstrap를 stylesheet로 링크를 건다
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js%22"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
 
<link rel = "stylesheet" href = "/css/bootstrap.css">
 
 
</head>
 
<style>
.menubar li ul {
background: rgb(109,109,109);
display:none;  /* 평상시에는 서브메뉴가 안보이게 하기 */
height:auto;
padding:0px;
margin:0px;
border:0px;
position:absolute;
width:200px;
z-index:200;
}
.dropbtn{
  background-color: black;
  color: white;
  padding: 16px;
  font-size: 16px;
  border: none;
}
.dropbtn b{
  background-color: red;
  color: white;
  padding: 16px;
  font-size: 16px;
  border: none;
}
.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-content {
  display: none;
  position: absolute;
  background-color: #f1f1f1;
  min-width: 150px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 1;
}
.dropdown-content b {
  display: none;
  position: absolute;
  background-color: #f1f1f1;
  min-width: 800px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 1;
}
.dropdown-content a {
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
}
.dropdown-content a:hover {background-color: #ddd;}
.dropdown:hover .dropdown-content {display: block;}
.dropdown:hover .dropbtn {background-color: #3e8e41;}
 
 
</style>
 
 
<center>
    <body>
        <nav class="navbar navbar-inverse">
            <div class="container-fluid">
                <div class="navbar-header">
                    <a class="navbar-brand" href="#">Hs-Project</a>
                </div>
 
                <div>
                    <!-- 다른 기능들 링크가 걸려있는 메뉴 페이지 -->
                    <ul class="nav navbar-nav">
                        <li class="active"><a href="${path}/home">Home</a></li>
                    
 
 
                <div class="dropdown">
                <button class="dropbtn">게시판</button>
                    <div class="dropdown-content">
                        <a href="${path}/board/list.do">회원 게시물</a>
                        <a href="${path}/board/best_list.do">베스트 게시물</a>
                    </div>
                </div>
    
                    <!-- 어떠한 아이디로든 로그인되지 않았을 경우에만 회원가입 링크를 출력시킨다. -->
                    <c:if
                        test="${sessionScope.user_id == null and sessionScope.navername == null and sessionScope.kakaonickname == null and sessionScope.facebookname == null and sessionScope.admin_id == null}">
                        <div class="dropdown">
                        <button class="dropbtn">회원</button>
                        <div class="dropdown-content">
                        <a href="${path}/member/email.do">회원가입</a>
                    </div>
                </div>
                    </c:if>
 
 
 
                    <!-- 관리자가 로그인 하지 않았을 경우에만 로그인 링크를 출력시킴 -->
                    <c:if
                        test="${sessionScope.user_id == null and sessionScope.navername == null and sessionScope.kakaonickname == null and sessionScope.facebookname == null and sessionScope.admin_id == null}">
                        
                        <div class="dropdown">
                        <button class="dropbtn">로그인</button>
                        <div class="dropdown-content">
                        <a href="${path}/admin/admin_login_view.do">관리자 로그인</a>
                        </div>
                        </div>
                    </c:if>
                    
                    
                        <div class="dropdown">
                        <button class="dropbtn">기타 기능</button>
                        <div class="dropdown-content">
                        <a href="${path}/member/smsform.do">문자 보내기</a>
                        <a href="${path}/member/e_mailform.do">이메일 보내기</a>
                        </div>
                        </div>
 
 
                        <div class="dropdown">
                        <button class="dropbtn">필독!!</button>
                        <div class="dropdown-content">
                    <a href="${path}/board/admin_board_list.do">회원 공지사항</a>
                        </div>
                        </div>
 
 
                    <c:if test="${sessionScope.admin_id != null}">
 
                        <div class="dropdown">
                        <button class="dropbtn">관리자 메뉴</button>
                            <div class="dropdown-content">
                                <a href="${path}/admin/admin_member_forced_eviction_view.do">회원강제 탈퇴</a>
                                <a href="${path}/admin/admin_member_info.do">회원 정보</a>
                        </div>
                    </div>
                    
                        
                    
                    
                        
                    
                    
                    </c:if>
                    
                    </ul>
                    
                    <div class="dropdown">
                        <button class="dropbtn b">만든이</button>
                            <div class="dropdown-content b">
                            <br><br>
                            <span style="color: green; font-weight: bold;">- 홈페이지 작성자 -</span>    <br><br>
                            이한섭 <br><br>
                            
                            <span style="color: green; font-weight: bold;">- 이메일 주소 -</span><br><br>
                            dlgkstjq623@naver.com <br><br>
                            
                            <span style="color: green; font-weight: bold;">- 휴대폰 번호 -</span><br><br>
                            010-7285-1455 <br><br>
                            
                        </div>
                    </div>
                    
                    
                </div>
            </div>
            
            
        </nav>
 
    </body>
    
</center>
 
</html>
cs






:

두개의 영역(그림, 글자, 광고 등)을 나란히 놓기 - float:left/right

Front-End/HTML 2019. 10. 1. 17:50

1. 영역 2개 만들기

[태그 모양]

<div style="width:150px; height:150px; border:1px solid red;">
첫번째 영역:
여기에 그림이나 글자 또는 광고 등을 넣음
</div>
<div style="width:150px; height:150px; border:1px solid green;">
두번째 영역:
여기에 그림이나 글자 또는 광고 등을 넣음
</div>


[적용후 모습]

첫번째 영역: 여기에 그림이나 글자 또는 광고 등을 넣음
두번째 영역: 여기에 그림이나 글자 또는 광고 등을 넣음



2. 두번째 영역을 첫번째 영역 옆에 올려 나란히 붙이기

위의 태그에 "float:left 또는 right;"를 추가한다.

[태그 모양]

<div style="width:200px; height:150px; border:1px solid red; float:left;">
첫번째 영역:
왼쪽에 위치시킴 =>  float:left
여기에 그림이나 글자 또는 광고 등을 넣음
</div>
<div style="width:200px; height:150px; border:1px solid green; float:left;">
두번째 영역:
첫번째 영역 옆에 나란히 붙임 => float:left
여기에 그림이나 글자 또는 광고 등을 넣음
</div>


[적용후의 모습]

첫번째 영역: 왼쪽에 위치시킴 => float:left 여기에 그림이나 글자 또는 광고 등을 넣음
두번째 영역: 첫번째 영역 옆에 나란히 붙임 => float:left 여기에 그림이나 글자 또는 광고 등을 넣음










두 영역사이를 띄우려면, margin(바깥 여백)을 준다.
첫번째 영역의 오른쪽에 여백을 주어도 되고, 두번째 영역의 왼쪽에 여백을 주어도 된다. 여기서는 첫번째 영역의 오른쪽에 여백을 준다.

[태그 모양]

<div style="width:200px; height:150px; border:1px solid red; float:left; margin-right:10px;">
첫번째 영역:
왼쪽에 위치시킴 =>  float:left
오른쪽에 바깥여백을 줌 =>  margin-right:10px;
여기에 그림이나 글자 또는 광고 등을 넣음
</div>
<div style="width:200px; height:150px; border:1px solid green; float:left;">
두번째 영역:
첫번째 영역 옆에 나란히 붙임 => float:left
여기에 그림이나 글자 또는 광고 등을 넣음
</div>


[적용후의 모습]

첫번째 영역: 왼쪽에 위치시킴 => float:left 오른쪽에 바깥여백을 줌 => margin-right:10px; 여기에 그림이나 글자 또는 광고 등을 넣음
두번째 영역: 첫번째 영역 옆에 나란히 붙임 => float:left 여기에 그림이나 글자 또는 광고 등을 넣음
 



3.두 영역을 나란히 놓되, 첫번째 영역은 왼쪽에 붙이고, 두번째 영역은 오른쪽으로 붙이기

[태그 모양]

<div style="width:200px; height:150px; border:1px solid red; float: left;">
첫번째 영역:
왼쪽에 위치시킴 =>  float:left
여기에 그림이나 글자 또는 광고 등을 넣음
</div>
<div style="width:200px; height:150px; border:1px solid green; float: right;">
두번째 영역:
첫번째 영역 옆에 나란히 붙임 => float:left
여기에 그림이나 글자 또는 광고 등을 넣음
</div>


[적용후의 모습]

첫번째 영역: 왼쪽에 위치시킴 => float:left 여기에 그림이나 글자 또는 광고 등을 넣음
두번째 영역: 첫번째 영역 옆에 나란히 붙임 => float:right 여기에 그림이나 글자 또는 광고 등을 넣음
 



※ 영역 아래의 글이 따라 올라가는 것 막기
위와 같이 영역을 설정하고 나면, 그 아래에 있는 글이나 그림이 영역 옆으로 딸려 올라가게 된다. 이것을 막는 방법은 몇 가지가 있는데, 그 가운데 가장 편한 방법은 두번째 영역을 지정한 </div>에 바로 붙여서 <div style="clear:both:"></div>를 추가하는 것이다.

[태그 모양]

<div style="width:200px; height:150px; border:1px solid red; float: left;">
첫번째 영역:
왼쪽에 위치시킴 =>  float:left
여기에 그림이나 글자 또는 광고 등을 넣음
</div>
<div style="width:200px; height:150px; border:1px solid green; float: right;">
두번째 영역:
첫번째 영역 옆에 나란히 붙임 => float:left
여기에 그림이나 글자 또는 광고 등을 넣음
</div><div style="clear:both:"></div>



※ 너비주기
실제로는 영역의 높이(height) 그리고 테두리(border:~)를 설정할 필요가 없는 경우가 많다. 그림이나 글씨 등을 넣게 되면, 높이는 그에 따라 자동으로 맞추어 지기 때문이다.

너비(width)는 두개의 영역이 나란히 놓여야 하므로 지정을 해주어야 한다.
전체 너비는 100%이므로, 왼쪽 오른쪽의 너비를 알맞은 비율(%)로 주어도 되고
예) width: 30%

비율이 아닌 고정너비(px)단위로 지정을 해주어도 된다.
예) 250px

[태그 모양: 왼쪽 영역의 너비는 30%를 주고, 오른쪽 영역의 너비는 65%를 줌, 두 영역 사이는 자동으로 5%(=100% - 30% - 65%)가 됨 ]

<div style="width: 30%; height:150px; border:1px solid red; float: left;">
첫번째 영역:
왼쪽에 위치시킴 =>  float:left
여기에 그림이나 글자 또는 광고 등을 넣음
</div>
<div style="width: 65%; height:150px; border:1px solid green; float: right;">
두번째 영역:
첫번째 영역 옆에 나란히 붙임 => float:left
여기에 그림이나 글자 또는 광고 등을 넣음
</div>


[적용후의 모습]

첫번째 영역: 왼쪽에 위치시킴 => float:left 여기에 그림이나 글자 또는 광고 등을 넣음
두번째 영역: 첫번째 영역 옆에 나란히 붙임 => float:right 여기에 그림이나 글자 또는 광고 등을 넣음

 

 

 

 

 

 

 

 

 

 

 

 

 

 

출처

 

https://ojji.wayful.com/2013/12/HTML-set-Two-Parallel-DIVs-columns.html

아래 책은 제가 공부할때 활용했던 책으로 추천드리는 책이니 한번씩 읽어보시는것을 추천드립니다!! ㅎㅎ

토비의 스프링 3.1 세트:스프링의 이해와 원리 + 스프링의 기술과, 에이콘출판

이 포스팅은 쿠팡 파트너스 활동의 일환으로, 이에 따른 일정액의 수수료를 제공받습니다.

'Front-End > HTML' 카테고리의 다른 글

HTML5 버전 이상 가운데 정렬 사용하기  (0) 2019.04.29
HTML 문법정리  (0) 2019.04.28
HTML 테이블 짜보기  (0) 2019.04.22
HTML 실습 주소  (0) 2019.04.22
:

Bootstrap 다운 및 스프링 프로젝트에 적용

Front-End/Bootstrap 2019. 9. 27. 15:05


1. http://bootstrapk.com/getting-started/#download 에 접속후 사진과 같이 부트스트랩 다운로드





2. 압축을 풀고, 아래 사진과 같이 resources 폴더 하위에 css폴더와, fonts폴더, js폴더를 저장한다.





3. servlet-context.xml 중 일부, resourcess가 맵핑될 수 있도록 맵핑 코드 추가


1
2
3
4
<resources mapping="/css/**" location="/resources/css/" /> 
<resources mapping="/images/**" location="/resources/images/" /> 
<resources mapping="/js/**" location="/resources/js/" /> 
<resources mapping="/resources/**" location="/resources/" /> 
cs



4. 마지막으로 사용할 때는 jsp 파일에 css파일의 링크를 걸고 사용할 디자인들을 <style> 태그 안에 넣어서 사용하면 된다.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<link rel = "stylesheet" href = "/css/bootstrap.css">
 
  <style>
    #container {
      width: 70%;
      margin: 0 auto;     /* 가로로 중앙에 배치 */
      padding-top: 10%;   /* 테두리와 내용 사이의 패딩 여백 */
    }
     
    #list {
      text-align: center;
    }
   
    #write {
      text-align: right;
    }
     
    /* Bootstrap 수정 */
    .table > thead {
      background-color: #b3c6ff;
    }
    .table > thead > tr > th {
      text-align: center;
    }
    .table-hover > tbody > tr:hover {
      background-color: #e6ecff;
    }
    .table > tbody > tr > td {
      text-align: center;
    }
    .table > tbody > tr > #title {
      text-align: left;
    }
     
    div > #paging {
      text-align: center;
    }
     
    .hit {
      animation-name: blink;
      animation-duration: 1.5s;
      animation-timing-function: ease;
      animation-iteration-count: infinite;
      /* 위 속성들을 한 줄로 표기하기 */
      /* -webkit-animation: blink 1.5s ease infinite; */
    }
     
    /* 애니메이션 지점 설정하기 */
    /* 익스플로러 10 이상, 최신 모던 브라우저에서 지원 */
    @keyframes blink {
      from {color: white;}
      30% {color: yellow;}
      to {color: red; font-weight: bold;}
      /* 0% {color:white;}
      30% {color: yellow;}
      100% {color:red; font-weight: bold;} */
    }
  </style>
cs


:

Bootstrap (부트스트랩) 이란??

Front-End/Bootstrap 2019. 9. 27. 14:53

부트스트랩 (Bootstrap) 은 웹사이트를 쉽게 만들 수 있게 도와주는 HTML, CSS, JS 프레임 워크이다.


하나의 CSS로 휴대폰, 태블릿, 데스크탑까지 다양한 기기에서 작동하고,


다양한 기능을 제공하여 사용자가 쉽게 웹사이트를 제작, 유지, 보수할 수 있도록 도와준다.


반응형 웹에서 많이 사용하고, Spring이 백엔드 프레임워크인것처럼 부트스트랩은 프론트엔드를 쉽게 사용하기 위한 프레임워크 이다.




출처

https://ko.wikipedia.org/wiki/부트스트랩_(프론트엔드_프레임워크)

:

포토샵 강의

Front-End/포토샵 2019. 9. 5. 10:32

출처

https://www.youtube.com/watch?v=4z376h77cK4&list=PLSRqixdIPzHyLVoSqWbl7rfpvHxHiw3j8&index=27

: