CSS : μμ νν λ°©λ²
CSSμμλ μμμ μ€μ νλ μ΄ 7κ°μ§μ λ°©λ²μ΄ μμ΅λλ€. λ¨Όμ κΈ°μ‘΄ CSSμ μλ λ°©λ² 3κ°μ§, CSS3μμ μΆκ°λ 4κ°μ§ λ°©λ²μ΄ μμ΅λλ€.
μ΄λ² μκ°μλ μ΄λ¬ν CSSμ μμ νν λ°©λ²μ λν΄ μμλ³΄κ² μ΅λλ€!π
πΆ CSS μμ νν λ°©λ² πΆ
#1. μμ μ΄λ¦μΌλ‘ νν
red, pinkμ κ°μ΄ μμμ μ΄λ¦μ λνλ΄λ λ°©λ²μΌλ‘, μ½ 140κ°μ§μ μμ μ΄λ¦λ€μ΄ λΈλΌμ°μ μ 미리 μ μλμ΄ μμ΅λλ€.
p {background-color: orange;}
orange
#2. RGBκ°μΌλ‘ νν
rgb(red, green, blue)μ κ°μ νμμΌλ‘ μμ ννν©λλ€.
μ¬κΈ°μ red, green, blue κ°κ°μ λ³μμλ 0μμ 255μ¬μ΄μ μ μλ₯Ό μ
λ ₯νκ±°λ λ°±λΆμ¨ κ°μ μ§μ νμ¬ μμμ μ€μ ν©λλ€.
p {background-color: rgb(255, 165, 0);}
p {background-color: rgb(100%, 0%, 0%);}
orange
red
#3. HEX(16μ§μ)κ°μΌλ‘ νν
hex(16μ§μ) μμκ°μ RGB μμκ°μ κ°κ° 16μ§μλ‘ λ³νν κ²μ
λλ€.
#rrggbb = rr: red / gg: green / bb : blueλ‘ 00μμ ffκΉμ§μ λ²μ κ°μ
λλ€.
p {background-color: #FFA500;}
orange
βοΈ HEX ν νμΈνκΈ°
μ΄λ¦ | μμ μ½λ |
μ΄λ¦ | μμ μ½λ |
μ΄λ¦ | μμ μ½λ |
---|---|---|---|---|---|
red | #FF0000 | lime | #00FF00 | blue | #0000FF |
indianred | #CD5C5C | aquamarine | #7FFFD4 | cyan(=aqua) | #00FFFF |
darksalmon | #E9967A | mediumspringgreen | #00FA9A | aqua(=cyan) | #00FFFF |
lightcoral | #F08080 | springgreen | #00FF7F | mediumturquoise | #48D1CC |
salmon | #FA8072 | palegreen | #98FB98 | darkturquoise | #00CED1 |
orangered | #FF4500 | greenyellow | #ADFF2F | cadetblue | #5F9EA0 |
crimson | #DC143C | chartreuse | #7FFF00 | slategray | #708090 |
firebrick | #B22222 | lawngreen | #7CFC00 | lightcyan | #E0FFFF |
darkred | #8B0000 | green | #008000 | paleturquoise | #AFEEEE |
mediumvioletred | #C71585 | lightgreen | #90EE90 | powderblue | #B0E0E6 |
pink | #FFC0CB | yellowgreen | #9ACD32 | lightsteelblue | #B0C4DE |
lightpink | #FFB6C1 | limegreen | #32CD32 | steelblue | #4682B4 |
hotpink | #FF69B4 | mediumseagreen | #3CB371 | lightblue | #ADD8E6 |
deeppink | #FF1493 | darkseagreen | #8FBC8F | skyblue | #87CEEB |
paleviolentred | #DB7093 | forestgreen | #228B22 | lightskyblue | #87CEFA |
darkkhaki | #BDB76B | seagreen | #2E8B57 | deepskyblue | #00BFFF |
khaki | #F0E68C | olivedrab | #6B8E23 | cornflowerblue | #6495ED |
palegoldenrod | #EEE8AA | olive | #808000 | royalblue | #4169E1 |
lightgoldenrodyellow | #FAFAD2 | darkolivegreen | #556B2F | mediumslateblue | #7B68EE |
lightyellow | #FFFFE0 | darkgreen | #006400 | dodgerblue | #1E90FF |
lemonchiffon | #FFFACD | mediumaquamarine | #66CDAA | mediumblue | #0000CD |
yellow | #FFFF00 | turquoise | #40E0D0 | darkblue | #00008B |
gold | #FFD700 | lightseagreen | #20B2AA | navy | #000080 |
papayawhip | #FFEFD5 | darkcyan | #008B8B | midnightblue | #191970 |
moccasin | #FFE4B5 | teal | #008080 | gainsboro | #DCDCDC |
peachpuff | #FFDAB9 | honeydew | #F0FFF0 | lightgrey | #D3D3D3 |
lightsalmon | #FFA07A | mintcream | #F5FFFA | silver | #C0C0C0 |
orange | #FFA500 | azure | #F0FFFF | darkgray | #A9A9A9 |
darkorange | #FF8C00 | aliceblue | #F0F8FF | gray(grey) | #808080 |
coral | #FF7F50 | ghostwhite | #F8F8FF | dimgray | #696969 |
tomato | #FF6347 | whitesmoke | #F5F5F5 | darkslategray | #2F4F4F |
orangered | #FF4500 | lavenderblush | #FFF0F5 | lightslategray | #778899 |
lavender | #E6E6FA | mistyrose | #FFE4E1 | peru | #CD853F |
thistle | #D8BFD8 | antiquewhite | #FAEBD7 | chocolate | #D2691E |
plum | #DDA0DD | seashell | #FFF5EE | maroon | #800000 |
violet | #EE82EE | snow | #FFFAFA | saddlebrown | #8B4513 |
fuchsia(=magenta) | #FF00FF | beige | #F5F5DC | brown | #A52A2A |
magenta(=fuchsia) | #FF00FF | linen | #FAF0E6 | sienna | #A0522D |
orchid | #DA70D6 | oldlace | #FDF5E6 | darkred | #8B0000 |
cornsilk | #FFF8DC | floralwhite | #FFFAF0 | burlywood | #DEB887 |
blanchedalmond | #FFEBCD | ivory | #FFFFF0 | tan | #D2B48C |
bisque | #FFE4E4 | mediumorchid | #BA55D3 | rosybrown | #BC8F8F |
navajowhite | #FFDEAD | darkorchid | #9932CC | mediumpurple | #9370DB |
blueviolet | #8A2BE2 | darkviolet | #9400D3 | darkmagenta | #8B008B |
slateblue | #6A5ACD | purple | #800080 | wheat | #F5DEB3 |
darkslateblue | #483D8B | indigo | #4B0082 | darkgoldenrod | #B8860B |
sandybrown | #F4A460 | goldenrod | #DAA520 | ||
black | #000000 | white | #FFFFFF |
πΆ CSS3μμ μΆκ°λ μμ νν λ°©λ² πΆ
#1. RGBA μμκ°μΌλ‘ νν
RGBA μμκ°μ RGB μμκ°μ μν μ±λ κ°μ λν μμκ°μ
λλ€.
μ¬κΈ°μ μν μ±λ(alpha channel)μ΄λ μμμ ν¬λͺ
λλ₯Ό λνλ΄λ μ±λμ
λλ€. μν μ±λ κ°μ μμ ν ν¬λͺ
μνμΈ 0.0λΆν° ν¬λͺ
λκ° μ ν μλ 1.0 μ¬μ΄μ κ°μ κ°μ§λλ€.
p {background-color: rgba(255, 165, 0, 0);}
p {background-color: rgba(255, 165, 0, 0.5);}
p {background-color: rgba(255, 165, 0, 1);}
orange
orange
orange
#2. HSL μμκ°μΌλ‘ νν
HSL μμκ°μ λΉμ μΌμμμΌλ‘ μμ νννλ RGB μμκ°κ³Όλ λ¬λ¦¬ μμ, μ±λ, λͺ
λλ₯Ό μ¬μ©ν΄μ μμ ννν©λλ€.
μ¦ HSLμ κ°κ° μμ(Hue), μ±λ(Saturation), λͺ
λ(Lightness)λ₯Ό μλ―Έν©λλ€.
μμμ 0λΆν° 360 μ¬μ΄μ κ°μ λ°λΌ κ²°μ λλ©°, μμν(color wheel)μ κ°λλ₯Ό λνλ
λλ€.
p {background-color: hsl(39, 100%, 50%);}
orange
#3. HSLAκ°μΌλ‘ νν
rgbaμ λ§μ°¬κ°μ§λ‘ hslμ λΆν¬λͺ λλ₯Ό μΆκ°ν μμ νν λ°©λ²μ λλ€.
p {background-color: hsl(39, 100%, 50%, 0);}
p {background-color: hsl(39, 100%, 50%, 0.5);}
p {background-color: hsl(39, 100%, 50%, 1);}
orange
orange
orange
'CSS' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
[CSS] μ λλ©μ΄μ μ€μ΅ : μμ§μ΄λ λ°μ€ (2) | 2022.08.30 |
---|---|
[CSS] μμλ₯Ό μ¨κΈ°λ λ°©λ² (6) | 2022.08.26 |
[CSS] CSS λ¨μμ μ’ λ₯ (2) | 2022.08.24 |
[CSS] μ΄λ―Έμ§ μ€νλΌμ΄νΈ κΈ°λ² + irν¨κ³Ό / λ°±κ·ΈλΌμ΄λ (3) | 2022.08.22 |
[CSS] SCSS μ€μ΅01 : μμ§μ΄λ κ°μμ§ μΌλ¬μ€νΈ πΆ (4) | 2022.08.19 |
λκΈ