阜新:检察官进校园讲法律
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
color
CSS ??? ??? ?? ? ?? ??? ???? <currentcolor>
? ?? ?????. currentcolor
? ?? ???? ??? ? ?? ???? ???, border-color
? ?? ??? ??????.
??? ??
color: rebeccapurple;
color: #00a400;
color: rgb(214, 122, 127);
color: hsl(30deg 82% 43%);
color: hsla(237deg 74% 33% / 61%);
color: hwb(152deg 0% 58% / 70%);
<section id="default-example">
<div class="example-container">
<p id="example-element">
London. Michaelmas term lately over, and the Lord Chancellor sitting in
Lincoln's Inn Hall. Implacable November weather.
</p>
</div>
</section>
#example-element {
font-size: 1.5em;
}
.example-container {
background-color: white;
padding: 10px;
}
HTML?? ?? ???? ?? CSS? HTML ??? ???? ???? ??? ???? ?? ? ????.
??
/* ??? ? */
color: currentcolor;
/* <named-color> ? */
color: red;
color: orange;
color: tan;
color: rebeccapurple;
/* <hex-color> ? */
color: #090;
color: #009900;
color: #090a;
color: #009900aa;
/* <rgb()> ? */
color: rgb(34, 12, 64, 0.6);
color: rgba(34, 12, 64, 0.6);
color: rgb(34 12 64 / 0.6);
color: rgba(34 12 64 / 0.3);
color: rgb(34 12 64 / 60%);
color: rgba(34.6 12 64 / 30%);
/* <hsl()> ? */
color: hsl(30, 100%, 50%, 0.6);
color: hsla(30, 100%, 50%, 0.6);
color: hsl(30 100% 50% / 0.6);
color: hsla(30 100% 50% / 0.6);
color: hsl(30 100% 50% / 60%);
color: hsla(30.2 100% 50% / 60%);
/* ?? ? */
color: inherit;
color: initial;
color: unset;
color
??? ??? <color>
?? ??? ?????.
?? ?? ????? ?? ?????. <gradient>
? ?? <image>
????? ??? ??? ? ????.
?
<color>
-
??? ??? ?? ??? ?.
?? ??
color =
<color>
??
?? ?? ?? ??? ??? ????.
p {
color: red;
}
p {
color: #f00;
}
p {
color: #ff0000;
}
p {
color: rgb(255, 0, 0);
}
p {
color: rgb(100%, 0%, 0%);
}
p {
color: hsl(0, 100%, 50%);
}
/* 50% ?? */
p {
color: rgba(255, 0, 0, 0.5);
}
p {
color: hsla(0, 100%, 50%, 0.5);
}
??? ????
?? ??? ?? ???? ???? ???? ?? ? ??? ?? ?? ???? ??? ?? ???? ?? ?????.
? ???? ???? ???? ??? ?? ?? ??? ???? ??? ? ????. ?? ? ??? ??? ?????(WCAG)? ?????, ??? ???? 4.5:1, ?? ? ? ???? 3:1? ???? ?????. ? ???? 18.66px ??? ?? ?? ?? 24px ??? ???? ???? ????.
??
Specification |
---|
CSS Color Module Level 4 # the-color-property |
Scalable Vector Graphics (SVG) 2 # ColorProperty |
??? | canvastext |
---|---|
???? | all elements and text. It also applies to ::first-letter and ::first-line . |
?? | yes |
?? ? | computed color |
Animation type | by computed value type |