πŸ’»Coding/πŸ“’ CSS

[css] css background : transparent λž€? | background : none μ΄λž‘ 차이점

μŒμ€μ‘ 2022. 9. 2. 15:12
728x90
λ°˜μ‘ν˜•
[css]
css background : transparent λž€?
/
background : none μ΄λž‘ 차이점은?
background: none;
background: transparent;

 

βœ… background : transparent λž€?
→ 

βœ… css background : transparent vs background : none ??
→ κ°„λ‹¨ν•˜κ²Œ  background의 색상을 없앨 λ•Œ μš°λ¦¬λŠ” none(μ—†μ• κΈ°), transparent(투λͺ…)을 μ‚¬μš©ν•  수 있음
→ 이 λ‘˜μ˜ 차이점을 μ•Œλ €λ©΄ background 속성을 μ•Œμ•„μ•Όν•˜κΈ° λ•Œλ¬Έμ— μ•„λž˜μ—μ„œ μžμ„Ένžˆ μ„€λͺ…!


βœ… μ–΄λ–€ κ²½μš°μ— μ‚¬μš©ν• κΉŒ?
→ 배경색이 μ§€μ •λœ μš”μ†Œμ˜ 배경을 μ—†μ• μ•Όν•˜λŠ” κ²½μš°μ— μ‚¬μš©

 

🟣 background 속성

background-color
background-image
background-repeat
background-attachment
background-position
background-size

🟣 ν•œμ€„λ‘œ μž‘μ„±ν•˜λŠ” 방법
background : color image repeat attachment position / size;
βœ“ μœ„μ—μ„œ positionκ³Ό sizeλŠ” 배경이미지λ₯Ό λ„£μœΌλ©΄ μ‚¬μš©ν•˜λŠ” 속성

 

🟠 none μ΄λΌλŠ” 속성값은 background-image에 μ‚¬μš©ν•˜λŠ” κ°’ μ•„λž˜μ™€ 같이 μ‚¬μš©ν•©λ‹ˆλ‹€!

/* none μ‚¬μš© μ½”λ“œ */

background-color: initial;
background-image: none;
background-repeat: initial; 
background-attachment: initial;
background-position: initial;

 

🟑 transparent μ΄λΌλŠ” 속성값은 background-color 에 μ‚¬μš©ν•˜λŠ” κ°’ μ•„λž˜μ™€ 같이 μ‚¬μš©ν•©λ‹ˆλ‹€!

/* transparent μ‚¬μš© μ½”λ“œ */

background-color: transparent;
background-image: initial;
background-repeat: initial;
background-attachment: initial;
background-position: initial;
728x90
λ°˜μ‘ν˜•