๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
IT-Engineering/HTML-CSS

๋ฐ”ํƒ•ํ™”๋ฉด ์ƒ‰์ƒ์—(background-color)์— linear-gradient๊ฐ€ ์ ์šฉ๋˜์ง€ ์•Š์•„์š”(CSS ๋ฌธ์ œ)

by ๐Ÿงž‍โ™‚๏ธ 2022. 8. 3.
๋ฐ˜์‘ํ˜•
 
ํ•ด๋‹น ๋ฌธ์ œ๋Š” body์— ์ ์šฉ๋˜๋Š” css์˜ ๋ฌธ์ œ์˜€์Œ.
background-color์— ์ ์šฉ๋˜์ง€ ์•Š๋Š” ๊ฒƒ์„ background๋กœ ๋ฐ”๊ฟ”์ฃผ๋ฉด ํ•ด๊ฒฐ ๋จ.
 
Before:
background-color: linear-gradient(180deg, #f08, #d0e);
 
After:
background: linear-gradient(180deg, #f08, #d0e);
 

 


 
์ฐธ๊ณ 
 
 
Because <gradient>s belong to the <image> data type, they can only be used where <image>s can be used. For this reason, linear-gradient() won't work on background-color and other properties that use the <color> data type.
๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€