SW/JavaScript
ํฌ๋ช ๋ก ๋ฉ์ธ ํ์ด์ง
ahhyeon
2023. 3. 6. 23:54
๐ป ํฌ๋ช ๋ก ๋ฉ์ธํ์ด์ง ๋ง๋ค๊ธฐ
โ๏ธ๋ถํธ์คํธ๋ฉ ์์ ํ ํ๋ฆฟ
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"
integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
crossorigin="anonymous"></script>
<title>ํฌํ์ด์ง</title>
<link href="https://fonts.googleapis.com/css2?family=Noto+Serif+KR:wght@200;300;400;500;600;700;900&display=swap"
rel="stylesheet">
</head>
<body>
<h1>๋ด์ง์ค(newjeans) ํฌ๋ช
๋ก</h1>
</body>
</html>
โ๏ธ๋ถํธ์คํธ๋ฉ ์ปดํฌ๋ํธ 5.0
๐ก๋ถํธ์คํธ๋ฉ์ Card → Quote ์ด์ฉํ๊ธฐ
Buttons
Use Bootstrap’s custom button styles for actions in forms, dialogs, and more with support for multiple sizes, states, and more.
getbootstrap.com
[1๋จ๊ณ] ํ์ดํ ๊ตฌํ
<style>
* {
font-family: 'Noto Serif KR', serif;
}
body {
background-color: rgb(155, 167, 175);
}
.mypic {
width: 100%;
height: 450px;
background-image: linear-gradient(0deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.5)), url('https://dimg.donga.com/wps/NEWS/IMAGE/2023/01/05/117300894.2.jpg');
background-position: center top;
background-repeat: no-repeat;
background-size: cover;
color: white;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.mypost {
width: 95%;
max-width: 500px;
margin: 20px auto 20px auto;
background-color: #5a5a5a;
box-shadow: 0px 0px 3px 0px rgb(115, 115, 115);
padding: 20px;
}
.mypost > button {
margin-top: 15px;
}
.mycards {
width: 95%;
max-width: 500px;
margin: auto;
}
.mycards > .card {
margin-top: 10px;
margin-bottom: 10px;
}
</style>
[2๋จ๊ณ] ์์๋จ๊ธฐ๊ธฐ ํฌ์คํ ๊ตฌํ
<div class="mypost">
<div class="form-floating mb-3">
<input type="text" class="form-control" id="name" placeholder="url">
<label for="floatingInput">๋๋ค์</label>
</div>
<div class="form-floating">
<textarea class="form-control" placeholder="Leave a comment here" id="comment"
style="height: 100px"></textarea>
<label for="floatingTextarea2">์์๋๊ธ</label>
</div>
<button onclick="save_comment()" type="button" class="btn btn-dark">์์ ๋จ๊ธฐ๊ธฐ</button>
</div>
[3๋จ๊ณ] ์์ ์นด๋ ๊ตฌํ
<div class="mycards" id="comment-list">
<div class="card">
<div class="card-body">
<blockquote class="blockquote mb-0">
<p>์๋ก์ด ์จ๋ฒ ๋๋ฌด ๋ฉ์ ธ์!</p>
<footer class="blockquote-footer">๋ฒ๋์ฆ</footer>
</blockquote>
</div>
</div>
<div class="card">
<div class="card-body">
<blockquote class="blockquote mb-0">
<p>์๋ก์ด ์จ๋ฒ ๋๋ฌด ๋ฉ์ ธ์!</p>
<footer class="blockquote-footer">๋ฒ๋์ฆ</footer>
</blockquote>
</div>
</div>
<div class="card">
<div class="card-body">
<blockquote class="blockquote mb-0">
<p>์๋ก์ด ์จ๋ฒ ๋๋ฌด ๋ฉ์ ธ์!</p>
<footer class="blockquote-footer">๋ฒ๋์ฆ</footer>
</blockquote>
</div>
</div>
โญ ๊ธฐ๋ฅ ์ถ๊ฐ
1. ์ค์๊ฐ ๋ ์จ ์ ๋ณด
๐๋ ์จ API
http://spartacodingclub.shop/sparta_api/weather/seoul
<script>
$(document).ready(function() {
$.ajax({
type: "GET",
url: "http://spartacodingclub.shop/sparta_api/weather/seoul",
data: {},
success: function (response) {
$('#temp').text(response['temp'])
},
});
});
</script>
[์์ฑ]