웹개발 2주차 숙제

<!DOCTYPE html>
<html lang="ko">

<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 rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
          integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

    <!-- Optional JavaScript -->
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
            integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
            crossorigin="anonymous"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
            integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
            crossorigin="anonymous"></script>

    <title>스파르타코딩클럽 | 부트스트랩 연습하기</title>
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Song+Myung&family=Yeon+Sung&display=swap" rel="stylesheet">
    <style>
        * {
            font-family: 'Song Myung', serif;
            font-family: 'Yeon Sung', cursive;
        }

        .wrap {
            width: 1300px;
            /*border: 1px solid red;*/
            height: 1300px;
        }

        .img {
            width: 1200px;
            height: 800px;
            background-image: url("https://post-phinf.pstatic.net/MjAxOTA5MDlfMTAz/MDAxNTY3OTk1NTUzNjE0.kRfgfTLQCUQIICJUfF045MyhGiqz3-uzyROcEcEANFcg.al06M1bjKYY1QGeFe0FwqsTVOv81vyw-as1sVB-ojdcg.JPEG/%EC%9A%B0%EB%93%9C%ED%96%A5%EC%88%98.jpg?type=w1200");
            background-size: cover;
            margin: auto;
        }

        .item-desc {
            width: 1200px;
            margin-top: 30px;
            margin-bottom: 30px;
        }

        .price {
            font-size: 30px;
            color: red;
        }

        p {
            font-size: 25px;
            font-weight: normal;
        }
        .rate {
            color: red;
        }

        .item-order {
            width: 900px;
            margin: auto;
        }

        .btn-order {
            margin: auto;
            width: 100px;
            display: block;
        }
    </style>
    <script>
        $(document).ready(function () {
            get_rate();
        });

        function get_rate() {
            $.ajax({
                type: "GET",
                url: "https://api.manana.kr/exchange/rate.json",
                data: {},
                success: function (response) {
                    let now_rate = response[1]['rate'];
                    $('#now-rate').text(now_rate);
                }
            })
        }

        function order() {
            alert('주문이 완료되었습니다!');
        }
    </script>
</head>

<body>
<div class="wrap">
    <div class="img"></div>
    <div class="item-desc">
        <h1>가을에 이성을 돌아보게 하는 우드계열 향수<span class="price">가격:100,000원~부터</span></h1>
        <p>가을에는 가을이 찾아온 숲을 표현한 듯 어딘가 따뜻하고 은은한 느낌을 주는 우드 계열 향수를 준비해보세요.</p>
        <p class="rate">달러-원 환율: <span id="now-rate">1219.15</span></p>
    </div>
    <div class="item-order">
        <div class="input-group mb-3">
            <div class="input-group-prepend">
                <span class="input-group-text" id="inputGroup-sizing-default">주문자 성함</span>
            </div>
            <input type="text" class="form-control" aria-label="name" aria-describedby="inputGroup-sizing-default">
        </div>

        <div class="input-group mb-3">
            <div class="input-group-prepend">
                <label class="input-group-text" for="inputGroupSelect01">수량</label>
            </div>
            <select class="custom-select" id="inputGroupSelect01">
                <option selected>--수량을 입력하세요--</option>
                <option value="1">One</option>
                <option value="2">Two</option>
                <option value="3">Three</option>
            </select>
        </div>
        <div class="input-group mb-3">
            <div class="input-group-prepend">
                <span class="input-group-text" id="inputGroup-sizing-default">주소</span>
            </div>
            <input type="text" class="form-control" aria-label="address" aria-describedby="inputGroup-sizing-default">
        </div>
        <div class="input-group mb-3">
            <div class="input-group-prepend">
                <span class="input-group-text" id="inputGroup-sizing-default">전화번호</span>
            </div>
            <input type="text" class="form-control" aria-label="phone-number"
                   aria-describedby="inputGroup-sizing-default">
        </div>
    </div>
    <button type="button" onclick="order()" class="btn btn-primary btn-order">주문하기</button>
</div>

</div>
</body>

</html
코드를 입력하세요

좋은 웹페이지 즐겨찾기