λ³Έλ¬Έ λ°”λ‘œκ°€κΈ°
CSS

css ν…Œλ‘λ¦¬μ„  border κ³Ό 색상 ν‘œν˜„, border-radius, λͺ¨μ„œλ¦¬ λ‘₯κΈ€κ²Œ

by HAPPYRIN 2023. 8. 12.

border : μ„ -λ‘κ»˜ μ„ -μ’…λ₯˜ μ„ -색상;
               μš”μ†Œμ˜ ν…Œλ‘λ¦¬ 선을 μ§€μ •ν•˜λŠ” 단좕 속성

  • border : μš”μ†Œμ˜ 크기가 컀짐, νŒ¨λ”©κ³Ό 같이..! 
  • border-width μ„ -λ‘κ»˜
    λ‹¨μœ„ : px, em, % λ“± λ‹¨μœ„λ‘œ μ§€μ •ν•˜λŠ” μ •ν™•ν•œ 수치둜 ν‘œν˜„!
  • border-style μ„ -μ’…λ₯˜
    none : μ„  μ—†μŒ
    solid : μ‹€μ„ (일반 μ„ )
    dashed : νŒŒμ„ , 점선
    dotted, double, groove, ridge, inset, outset 등이 μžˆλ‹€.
  • border-color μ„ -색상
    black : 검정색 (κΈ°λ³Έκ°’)
    색상 : μ„ μ˜ 색상 (직접 μ§€μ •)
    transparent : 투λͺ…

 top, right, bottom, left; λͺ¨λ‘μ μš©

top, bottom right, left;

top left,right bottom;

top, right, bottom, left; μ‹œκ³„λ°©ν–₯으둜 적용

 

border-λ°©ν–₯

border-λ°©ν–₯-속성

 

border-top : λ‘κ»˜ μ’…λ₯˜ 색상;

border-top-width : λ‘κ»˜;

border-top-style : μ’…λ₯˜;

border-top-color : 색상;

 


 

색상 ν‘œν˜„

  • 색상 이름 : λΈŒλΌμš°μ €μ—μ„œ μ œκ³΅ν•˜λŠ” 색상 이름 => red, tomato, royalblue...
  • Hex μƒ‰μƒμ½”λ“œ : 16μ§„μˆ˜ 색상(Hexadecimal Colors) => #000, #FFFFF...
  • RGB : λΉ›μ˜ 삼원색 => rgb(255, 255, 255)
  • RGBA : λΉ›μ˜ 삼원색 + 투λͺ…도 => rgba(0, 0, 0, 0.5) λ§ˆμ§€λ§‰μ΄ 투λͺ…도..! 0~1 (1이 뢈투λͺ…)

 


border-radius : μš”μ†Œμ˜ λͺ¨μ„œλ¦¬λ₯Ό λ‘₯κΈ€κ²Œ 깎음

  • 0 : λ‘₯κΈ€κ²Œ μ—†μŒ
  • λ‹¨μœ„ : px, em, vw λ“± λ‹¨μœ„λ‘œ μ§€μ •

border-radius : 0;

border-radius : 10px;

border-radius : 0 10px 0 0; (값이 4κ°œμΌλ• μ™Όμͺ½ 상단뢀터 μ‹œκ³„λ°©ν–₯으둜 λˆλ‹€)

                           μ™Όμͺ½ 였λ₯Έμͺ½ 였λ₯Έμͺ½μ•„λž˜ μ™Όμͺ½μ•„λž˜

 


 

 

https://developer.mozilla.org/ko/docs/Web/CSS/border

 

border - CSS: Cascading Style Sheets | MDN

CSS border 단좕 속성은 μš”μ†Œμ˜ ν…Œλ‘λ¦¬λ₯Ό μ„€μ •ν•©λ‹ˆλ‹€. border-width, border-style, border-color의 값을 μ„€μ •ν•©λ‹ˆλ‹€.

developer.mozilla.org