투케이2K

61. (html/css/javascript/jquery) 부트스트랩 (bootstrap) Forms 폼 양식 사용해 간단한 회원가입 화면 만들기 본문

FrontEnd

61. (html/css/javascript/jquery) 부트스트랩 (bootstrap) Forms 폼 양식 사용해 간단한 회원가입 화면 만들기

투케이2K 2021. 7. 22. 13:36
반응형

[ 개발 환경 설정 ]

개발 툴 : Edit++

개발 언어 : html, css, js, jquery


[소스 코드]

<!DOCTYPE HTML>
<!-- 자바스크립트 차단된 콘텐츠 자동 허용 실시 -->
<!-- saved from url=(0013)about:internet -->

<!-- 표시 언어 지정 -->
<html lang="ko">

<!-- 헤더 정의 부분 -->
<head>
    <title>HTML TEST</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">  

    <!-- Jquery CDN 로드 : 항상 최신 버전 사용 -->    
    <script src="https://code.jquery.com/jquery-latest.min.js"></script> 


    <!-- 부트스트랩 CDN 로드 : 항상 최신 버전 사용 : maxcdn -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css">
    <!-- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/latest/js/bootstrap.min.js"></script>  -->
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/latest/js/bootstrap.bundle.min.js"></script>    


    <!-- 부트스트랩 CDN 로드 : 항상 최신 버전 사용 : netdna -->
    <!-- <link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css"> -->
    <!-- <script src="https://netdna.bootstrapcdn.com/bootstrap/latest/js/bootstrap.min.js"></script> -->

    

    <!-- 내부 CSS 스타일 지정 -->
    <style>			    			 	    	

		/* [html, body 영역 스타일 지정] */
		html, body{
			width : 100%;
			height : 100%;
			margin : 0;
			padding : 0;
			border : none;	
			overflow : auto;				
		}		
		
		/* [body 스크롤바 메인 스타일 지정] */
		body::-webkit-scrollbar {
			width: 10px;
			background-color: #c1c1c1;
		}
		/* body 스크롤바 thumb 스타일 지정 */
		body::-webkit-scrollbar-thumb {		
			background-color: #444444;
		}
		      				                          
    </style>



    <!-- 내부 JS 지정 -->
    <script>
    	
    	/* [html 최초 로드 및 이벤트 상시 대기 실시] */
    	window.onload = function() {
    		console.log("");
    		console.log("[window onload] : [start]");
    		console.log(""); 

    		// 이벤트 함수 호출
    		main();
    	};

    	function main(){
    		console.log("");
    		console.log("[main] : [start]");
    		console.log(""); 
    	};
    	
    </script>

</head>


<body>

	<!-- 
	[요약 설명]	
	1. Forms : 컨트롤 요소(control element)를 그룹 지어 양식 레이아웃을 만들 수 있습니다	
	2. 부트스트랩 공식 사이트 : https://getbootstrap.com/docs/4.1/components/forms/
	 -->


	<!-- 레이아웃 정의 -->
	<div id="dId" class="p-3 mb-2 bg-primary text-white" 
		style="width: 70%; margin: 0 auto; text-align: center; border-radius: 5px; font-weight: bold; font-size: 130%;">
		사용자 회원가입
	</div>

	<form style="width: 70%; margin: 0 auto;">	  
	  <div class="form-group">
	    <label for="exampleInputEmail1">ID</label>	    
	    <input class="form-control" class="form-control" type="text" placeholder="ID">	    
	  </div>

	  <div class="form-group">
	    <label for="exampleInputPassword1">Password</label>
	    <input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
	    <small id="emailHelp" class="form-text text-muted">영문과 숫자를 조합해서 비밀번호를 입력해주세요</small>
	  </div>

	  <div class="form-group">
	    <label for="exampleInputEmail1">Email</label>
	    <input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter email">	    
	    <small id="emailHelp" class="form-text text-muted">@ 주소까지 모두 입력해주세요 ex : test123@test.com</small>
	  </div>

	  <div class="form-group form-check">
	    <input type="checkbox" class="form-check-input" id="exampleCheck1">
	    <label class="form-check-label" for="exampleCheck1">개인 정보 동의</label>	    
	  </div>
	  <div class="form-group">
	    <div class="card">	  	
	      <div class="card-body">		 
	        <p class="card-text">With supporting text below as a natural lead-in to additional content.</p>		        
	      </div>
	    </div>
	  </div>

	  <button type="submit" class="btn btn-primary" style="width: 100%; font-weight: bold; font-size: 130%;">회원 가입</button>
	</form>

</body>

</html>

[결과 출력]


[요약 설명]

1. Forms : 컨트롤 요소(control element)를 그룹 지어 양식 레이아웃을 만들 수 있습니다

2. 부트스트랩 공식 사이트 : https://getbootstrap.com/docs/4.1/components/forms/


 

반응형
Comments