๋ฐ˜์‘ํ˜•
250x250
Recent Posts
ยซ   2024/12   ยป
์ผ ์›” ํ™” ์ˆ˜ ๋ชฉ ๊ธˆ ํ† 
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
๊ด€๋ฆฌ ๋ฉ”๋‰ด

Hello creators ๐Ÿ™Œ

1-11_Quiz_ํฌ์ŠคํŒ…๋ฐ•์Šค๋ฅผ ์™„์„ฑํ•˜๊ธฐ! ๋ณธ๋ฌธ

[WEB & AI] (feat. ์ทจ์ค€)/์ŠคํŒŒ๋ฅดํƒ€์ฝ”๋”ฉํด๋Ÿฝ_์›น๊ฐœ๋ฐœ์ข…ํ•ฉ๋ฐ˜

1-11_Quiz_ํฌ์ŠคํŒ…๋ฐ•์Šค๋ฅผ ์™„์„ฑํ•˜๊ธฐ!

๋ถ€์‹œ๋งค๋‚˜_HA 2023. 9. 28. 22:22
728x90
๋ฐ˜์‘ํ˜•

์ด๋ฒˆ ํšŒ์ฐจ ํ•™์Šต ๋ชฉํ‘œ (goal)


  • ์ดํ•ด ํ•˜๊ณ ์ž ํ•˜๋Š” ๊ฒƒ
    • 'CSS'
    • ๊ธฐ๋ณธ HTML ๋ฐ CSS ์…‹ํŒ… ํ•˜๊ณ  ๋‚œ ํ›„ -> ==๋ถ€ํŠธ์ŠคํŠธ๋žฉ ํ™œ์šฉ ํ•ด๋ณด๊ธฐ==

  • ๋งŒ๋“ค๊ณ ์ž ํ•˜๋Š” ๊ฒƒ์€?
    • ์ด๋Ÿฐ box ๋งŒ๋“ค๊ณ  '๋ชจ๋ฐ”์ผ ์ฒ˜๋ฆฌ' ๊นŒ์ง€ ํ•˜๊ธฐ

  • ๋ณต์Šต ๋ฐฉ๋ฒ•
    • ์ด ๋…ธํŠธ๋„ ํ•œ ํ์— ์™„์„ฑํ•  ์ˆ˜ ์—†์Œ.
    • ๋™์˜์ƒ ๋ฐ ์‚ฌ์ง„์„ ๋ฐ”๋กœ ๋„ฃ์„ ์ˆ˜ ์žˆ์–ด์•ผ ๋นจ๋ฆฌ ๋“ค์–ด๊ฐ€๊ฒŒ ํ•  ์ˆ˜ ์žˆ์Œ. โญโญโญโญโญ โญโญโญโญโญโญโญโญ


๋งŒ๋“ค์–ด๋ณด๊ธฐ


โ… . ๊ธฐ์ดˆ html ๋ฐ css ์ž‘์„ฑ


  1. html ์˜์—ญ ์ตœ์ข… ์ฝ”๋“œ

     <div class="mypost">
         ๊ฐ„๋‹จํ•œ ๊ธ€์”จ๋ฅผ ์”๋‹ˆ๋‹ค.
     </div>

  2. css ์˜์—ญ ์ตœ์ข… ์ฝ”๋“œ

     .mypost{
         /* div ์˜์—ญ ์žก์„ ๋•Œ, ๋ฐฑ ๊ทธ๋ผ์šด๋“œ ์˜์—ญ ์žก๊ณ  ํ•˜๋Š”๊ฒŒ ์ข‹์Œ โญโญ  */
         /* background-color: green; */
         width: 500px;
    
         /* ์œ„์— ์‚ด์ง ๋„์šฐ๊ณ  div ์˜์—ญ ์žก๊ณ  ์‹ถ์Œ -> 10px, 0px ๋งŒ๋“ฆ */
         margin: 20px auto 0px auto;
    
         /* ๋ฐ•์Šค shadow ๋„ฃ๊ธฐ */
         box-shadow: 0px 0px 3px 0px gray;
    
         padding: 20px;
    
     }
  1. ๊ฒฐ๊ณผ๋ฌผ
    (์šฐ์„ , ์ด๋ ‡๊ฒŒ ํ•ด๋‹น ์˜์—ญ์„ ํ™•์ธ)
  • 1์ฐจ ๊ฒฐ๊ณผ๋ฌผ (box - shadow, padding์—†๋Š” ๊ฒฐ๊ณผ๋ฌผ)

  • box-shadow, padding ํฌํ•จ ๊ฒฐ๊ณผ๋ฌผ

  • ์ตœ์ข… ๊ฒฐ๊ณผ๋ฌผ ![[Pasted image 20230123185500.png]]



โ…ก. ๋ถ€ํŠธ์ŠคํŠธ๋žฉ

1. '์˜ํ™” URL' ์€ ์–ด๋”” ์ฐธ์กฐ?

  • ๋ถ€ํŠธ์ŠคํŠธ๋žฉ์—์„œ forms > floating labels > email address
`<div class="form-floating mb-3">
  <input type="email" class="form-control" id="floatingInput" placeholder="name@example.com">
  <label for="floatingInput">Email address</label>
</div>`

2. '๋ณ„์  ๋ฐ•์Šค' ๋Š” ์–ด๋””์—์„œ ์ฐธ๊ณ ? ์–ด๋””์— ๋„ฃ์–ด?

  • input group > custom forms
    <div class="input-group mb-3">
    <label class="input-group-text" for="inputGroupSelect01">Options</label>
    <select class="form-select" id="inputGroupSelect01">
      <option selected>Choose...</option>
      <option value="1">One</option>
      <option value="2">Two</option>
      <option value="3">Three</option>
    </select>
    </div>


3. ์ฝ”๋ฉ˜ํŠธ URL

  • Forms ์˜ Floating Labels์˜ Textareas ์ฐธ๊ณ 
<div class="form-floating">
  <textarea class="form-control" placeholder="Leave a comment here" id="floatingTextarea2" style="height: 100px"></textarea>
  <label for="floatingTextarea2">Comments</label>
</div>
  • ์ด๊ฑธ ์–ด๋””์— ๋„ฃ์–ด?


4. ๊ธฐ๋กํ•˜๊ธฐ, ๋‹ซ๊ธฐ ๋ฒ„ํŠผ


(1) Button ๋‘ ๊ฐœ๋ฅผ ๋ฌถ์„ div๋ฅผ ๋งŒ๋“ค๊ธฐ

<!-- ๋ฒ„ํŠผ -->
<div class="mybtn">
    <button type="button" class="btn btn-dark">๊ธฐ๋กํ•˜๊ธฐ๐Ÿ‘‡</button>
    <button type="button" class="btn btn-light">๋‹ซ๊ธฐ๐Ÿ™Œ</button>

</div>

(2) ๋ถ€ํŠธ์ŠคํŠธ๋žฉ 5.0 ํŽ˜์ด์ง€์—์„œ ๋ฒ„ํŠผ ๊ฐ€์ ธ์˜ค๊ธฐ ![[Pasted image 20230123191802.png]]



(3) display flex ๋กœ mybtn ๊พธ๋ฉฐ์„œ -> ๊ฐ€์šด๋ฐ๋กœ ์˜ค๊ฒŒ ํ•˜๊ธฐ

.mybtn{
    /* โญโญโญ ๊ฐ€์šด๋ฐ๋กœ ์†์‰ฝ๊ฒŒ ์ •๋ ฌํ•˜๊ธฐ (4๊ฐ€์ง€๊ฐ€ set) */
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;

    margin-top: 10px;
}


(๊ฒฐ๊ณผ๋ฌผ)![[Pasted image 20230123192322.png]]

5. button ๋“ค ๊ฐ„ ๊ฐ„๊ฒฉ ๋„์šฐ๊ธฐ

  • mybtn ์•ˆ์— ์žˆ๋Š” button ์„ ์˜๋ฏธํ•˜๋Š”๋ฐ,
    • ์ด๋•Œ, button ์ด 2๊ฐœ ์žˆ๋Š”๋ฐ, ํ•˜๋‚˜๋งŒ ๊ฐ€๋ฆฌํ‚ค๋Š” ๊ฑด๊ฐ€?
    • ์›€์ง์ด๋Š” ๋ชจ์–‘์„ ๋ณด๋ฉด ๊ทธ๋Ÿฐ๊ฑฐ ๊ฐ™์€๋ฐ?
    • ์™„์ „ ๊ฐ€์šด๋ฐ๊ฐ€ ์•„๋‹ˆ๋ผโ“โ“โ“
.mybtn > button {
    margin-right: 10px;
}


6. ๋ชจ๋ฐ”์ผ ์ฒ˜๋ฆฌ #๋ชจ๋ฐ”์ผ์ฒ˜๋ฆฌ


  • ๋ชจ๋ฐ”์ผ ์ฒ˜๋ฆฌ ํ•„์š”์„ฑ
    • ์ด๋ ‡๊ฒŒ ์ค„์ด๋ฉด -> ์ •ํ•ด์ง„ ํ™”๋ฉด ๋ฐ–์œผ๋กœ ๋‚˜๊ฐ€๊ฒŒ ๋จ.![[Pasted image 20230123192759.png]]

  • ์›์ธ
    • ์ฝ”๋ฉ˜ํŠธ ๋ฐ•์Šค๋ฅผ ๋ฌด์กฐ๊ฑด 500px ์œผ๋กœ ๊ณ ์ •ํ•ด ๋†จ๊ธฐ ๋•Œ๋ฌธ. ![[Pasted image 20230123192927.png]]

  • ์†”๋ฃจ์…˜
    • 500 ๊นŒ์ง€๋Š” width ๊ฐ€ 95% ์•ผ.

  • ์–ด๋””์— ์–ด๋–ค ์ฝ”๋“œ๋ฅผ ์จ์•ผ ํ•ด?

    • .wrap & mypost

      .wrap { 
      
      /* ํ™”๋ฉด ๋ณ€ํ™”์— ์•ˆ ๊นจ์ง€๋Š” ํ™”๋ฉด ๋งŒ๋“ค๊ธฐ */
      /* ์ปค์ง€๋ฉด ์ตœ๋Œ€ 1200px ๊นŒ์ง€๋งŒ ์ปค์งˆ ์ˆ˜ ์žˆ์–ด! */
      max-width: 1200px;
      /* ๊ทธ ์ด์ „์—๋Š” 95% ๋งŒ ์ปค์งˆ ์ˆ˜ ์žˆ์–ด.*/
      width: 95%;
      }
      

.mypost{

/* ํ™”๋ฉด ๋ณ€ํ™”์— ์•ˆ ๊นจ์ง€๋Š” ํ™”๋ฉด ๋งŒ๋“ค๊ธฐ */
/* ์ปค์ง€๋ฉด ์ตœ๋Œ€ 1200px ๊นŒ์ง€๋งŒ ์ปค์งˆ ์ˆ˜ ์žˆ์–ด! */
max-width: 1200px;
/* ๊ทธ ์ด์ „์—๋Š” 95% ๋งŒ ์ปค์งˆ ์ˆ˜ ์žˆ์–ด.*/
width: 95%;
<br>

- ๊ฒฐ๊ณผ๋ฌผ (before ๋ž‘ ๋น„๊ต) 
    - ๋ชจ๋ฐ”์ผํ™”๋ฅผ ํ•˜๋ฉด 
        - 1200px ์ด์ „์—๋Š” 95% ๊นŒ์ง€
        - 1200px ์ดํ›„์—๋Š” 1200px ๊นŒ์ง€๋งŒ ํฐ๋‹ค. ![](https://i.imgur.com/uNknExl.gif)


- ๋ชจ๋ฐ”์ผ ๋ฒ„์ „ ํ™•์ธํ•˜๋ ค๋ฉด 
    - `f12` ๊ฒ€์‚ฌ์ฐฝ ๋ˆ„๋ฅด๊ณ  -> ์˜ค๋ฅธ์ชฝ ๋ˆ„๋ฅด๋ฉด ํ™•์ธ ๊ฐ€๋Šฅ ![](https://i.esdrop.com/d/f/yRK3Pc5dvM/GIIokjyAwY.jpg)


728x90
๋ฐ˜์‘ํ˜•
Comments