웹개발 교육/Bootstrap

[45일] bootstrap (8) - modal

2022. 9. 29. 17:18

https://www.w3schools.com/bootstrap/bootstrap_modal.asp

 

Bootstrap Modals

W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

www.w3schools.com

 

 

위의 회원가입 창이 자식, 아래 사이트가 부모이다. modal은 부모와 자식이 함께 간다. 자식 창을 닫아야 부모 창에 접근할 수 있다.

 

반면 window.open은 부모 창과 자식 창이 서로 독립적인 별도의 창이다.

위에 있는 창을 닫지 않아도 아래 창에 접근할 수 있다.

 

 

<!DOCTYPE html>
<html lang="ko">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>08_modal.html</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</head>
<body>
    <!-- 참조 https://www.w3schools.com/bootstrap/bootstrap_modal.asp -->
    <!--
        - modal         : 부모 창과 자식 창이 한몸으로 구성되어 있다.
        - window.open() : 부모 창과 자식 창이 서로 독립적 관계이다 (팝업창)
    -->

    <div class="container">
        <h2>Modal Example</h2>
        <!-- Trigger the modal with a button -->
        <button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Open Modal</button>
      
        <!-- Modal -->
        <div class="modal fade" id="myModal" role="dialog">
          <div class="modal-dialog">
          
            <!-- Modal content-->
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">Modal Header</h4>
              </div>
              <div class="modal-body">
                <p>Some text in the modal.</p>
              </div>
              <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
              </div>
            </div>
            
          </div>
        </div>
        
      </div>
</body>
</html>
08_modal.html

Modal Example

Modal Header

Some text in the modal.

'웹개발 교육 > Bootstrap' 카테고리의 다른 글

[46일] bootstrap (10) - grid  (0) 2022.09.30
[45일] bootstrap (9) - icon  (0) 2022.09.29
[45일] bootstrap (7) - container  (0) 2022.09.29
[45일] bootstrap (6) - input  (0) 2022.09.29
[45일] bootstrap (5) - pagination  (0) 2022.09.29
'웹개발 교육/Bootstrap' 카테고리의 다른 글
  • [46일] bootstrap (10) - grid
  • [45일] bootstrap (9) - icon
  • [45일] bootstrap (7) - container
  • [45일] bootstrap (6) - input
ewok
ewok
ewok
기록장
ewok
전체
오늘
어제
  • 분류 전체보기
    • 웹개발 교육
      • HTML
      • CSS
      • JavaScript
      • Database
      • Java
      • jQuery
      • Ajax
      • Bootstrap
      • jsp
      • Spring
      • MyBatis
      • 프로젝트
    • JAVA
    • SpringBoot
      • 기초
      • AWS
      • 개인프로젝트
    • Spring Security
    • JPA
    • 테스트코드
    • Error
    • CS
      • 컴퓨터 구조
      • 이산수학
    • 알고리즘
      • 정리
      • Java
    • SQL
    • 자격증
      • SQLD
      • 정보처리기사
    • Git

블로그 메뉴

  • 홈
  • 태그
  • 방명록

공지사항

인기 글

태그

  • git bash
  • 버전 관리
  • merge commit
  • branch
  • org.hibernate.tool.schema.spi.CommandAcceptanceException
  • sqld 자격증
  • 생성자
  • 노랭이
  • org.springframework.beans.factory.UnsatisfiedDependencyException
  • sqld 합격
  • GIT
  • this
  • 브랜치
  • base
  • SQLD

최근 댓글

최근 글

hELLO · Designed By 정상우.
ewok
[45일] bootstrap (8) - modal
상단으로

티스토리툴바

단축키

내 블로그

내 블로그 - 관리자 홈 전환
Q
Q
새 글 쓰기
W
W

블로그 게시글

글 수정 (권한 있는 경우)
E
E
댓글 영역으로 이동
C
C

모든 영역

이 페이지의 URL 복사
S
S
맨 위로 이동
T
T
티스토리 홈 이동
H
H
단축키 안내
Shift + /
⇧ + /

* 단축키는 한글/영문 대소문자로 이용 가능하며, 티스토리 기본 도메인에서만 동작합니다.