HTML рдореЗрдВ Colors рдХрд╛ рдЙрдкрдпреЛрдЧ webpage рдХреЛ рдЖрдХрд░реНрд╖рдХ рдФрд░ readable рдмрдирд╛рдиреЗ рдХреЗ рд▓рд┐рдП рдХрд┐рдпрд╛ рдЬрд╛рддрд╛ рд╣реИред рдЖрдк рдХрд┐рд╕реА рднреА text, background, border, рдпрд╛ element рдореЗрдВ colors рдЬреЛрдбрд╝ рд╕рдХрддреЗ рд╣реИрдВред
HTML рдореЗрдВ colors рдХреЛ рдЖрдорддреМрд░ рдкрд░ CSS (Cascading Style Sheets) рдХреЗ рдорд╛рдзреНрдпрдо рд╕реЗ apply рдХрд┐рдпрд╛ рдЬрд╛рддрд╛ рд╣реИред
рдЖрдк colors рдЗрди рддрд░реАрдХреЛрдВ рд╕реЗ specify рдХрд░ рд╕рдХрддреЗ рд╣реИрдВ:
rgb(255,0,0)
)#FF0000
)hsl(0, 100%, 50%)
)рдЗрд╕ chapter рдореЗрдВ рд╣рдо Color Name method рдкрд░ рдлреЛрдХрд╕ рдХрд░реЗрдВрдЧреЗред
HTML рдореЗрдВ predefined 140+ color names рд╣реЛрддреЗ рд╣реИрдВред рдпреЗ colors browser рджреНрд╡рд╛рд░рд╛ рдкрд╣рдЪрд╛рди рд▓рд┐рдП рдЬрд╛рддреЗ рд╣реИрдВ рдФрд░ рдЖрдк рдЗрдиреНрд╣реЗрдВ рд╕реАрдзрд╛ use рдХрд░ рд╕рдХрддреЗ рд╣реИрдВред
<p style="color: red;">рдпрд╣ рд▓рд╛рд▓ рд░рдВрдЧ рдореЗрдВ рд╣реИ</p>
<h3 style="color: blue;">This is Blue Text</h3>
<p style="color: green;">This paragraph is in Green</p>
<p style="color: orange;">Orange is a bright color!</p>
This is Blue Text
This paragraph is in Green
Orange is a bright color!
<body style="background-color: lightgray;">
<h2 style="color: navy;">Welcome to My Website</h2>
</body>
(Page background will be light gray, and heading text will be navy)
Color Name | Output |
---|---|
red | red |
green | green |
blue | blue |
black | black |
white | white |
gray | gray |
orange | orange |
pink | pink |
purple | purple |
yellow | yellow |
ЁЯСЙ Hint:
<p style="color: white; background-color: black;">This is white on black</p>