[CSS] ๋ถ€ํŠธ์ŠคํŠธ๋žฉ ์‚ฌ์šฉํ•˜๊ธฐ

2021. 3. 31. 16:33

HTML ํŒŒ์ผ์„ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์‹œ์ž‘ํ•œ๋‹ค.

<!doctype html>
<html lang="en">

<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>
</head>

<body>
    <h1>์ œ๋ชฉ</h1>
</body>

</html>

๋ถ€ํŠธ์ŠคํŠธ๋žฉ์„ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด CSS ๋งํฌ์™€ javascript ๋งํฌ๋ฅผ ๋„ฃ์–ด์ค€ ๊ฒƒ์ด๋‹ค.

CSS ํŒŒ์ผ์„ ๋”ฐ๋กœ ๋งŒ๋“ค์–ด์ฃผ๊ณ  HTML์— ์—ฐ๊ฒฐํ•˜๋“ฏ์ด ์ธํ„ฐ๋„ท ์ƒ์— ์žˆ๋Š” ๋ถ€ํŠธ์ŠคํŠธ๋žฉ CSS ํŒŒ์ผ์„ ์—ฐ๊ฒฐํ•ด์ฃผ๋Š” ๊ฒƒ์ด๋‹ค. 

 

https://getbootstrap.com/docs/4.0/components/alerts/

 

Alerts

Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages.

getbootstrap.com

์œ„์˜ ๋ถ€ํŠธ์ŠคํŠธ๋žฉ ์‚ฌ์ดํŠธ์—์„œ ์›ํ•˜๋Š” ๋””์ž์ธ์„ ๊ณ ๋ฅด๊ณ  ํ•ด๋‹น ์ฝ”๋“œ๋ฅผ ๋ณต์‚ฌํ•ด ์›ํ•˜๋Š” ์œ„์น˜์— ๋ถ™์—ฌ๋„ฃ์–ด์ค€๋‹ค.

๋ถ€ํŠธ์ŠคํŠธ๋žฉ ๋””์ž์ธ์—์„œ ๋‚˜๋งŒ์˜ ๋””์ž์ธ์„ ์ถ”๊ฐ€ํ•˜๊ณ  ์‹ถ์„ ๋•Œ style์„ ๋”ฐ๋กœ ์ž‘์„ฑํ•˜์—ฌ class ์ด๋ฆ„์„ ํ•˜๋‚˜ ๋” ์ถ”๊ฐ€ํ•˜๋ฉด ๋œ๋‹ค.

 

<button type="button" class="btn btn-primary">Primary</button>

์˜ˆ๋ฅผ ๋“ค์–ด ์œ„์™€ ๊ฐ™์€ ๋ถ€ํŠธ์ŠคํŠธ๋žฉ์—์„œ ๊ฐ€์ ธ์˜จ ๋ฒ„ํŠผ์„ ์ƒ์„ฑํ•  ๋•Œ,

๋‚˜๋งŒ์˜ ๋””์ž์ธ์„ ์ž‘์„ฑํ•ด ๋†“์€ mybtn์„ ์ถ”๊ฐ€ํ•˜๊ณ  ์‹ถ๋‹ค๋ฉด

<button type="button" class="btn btn-primary mybtn">Primary</button>

class ์ด๋ฆ„์— mybtn์„ ์ถ”๊ฐ€ํ•ด์ฃผ๋ฉด ๋œ๋‹ค.

728x90

BELATED ARTICLES

more