css color property


  Translation results:

color

英['kʌlə(r)] 美[ˈkʌlɚ]

n.<Beauty>Color, color; skin color, complexion, blood color ;Pigment, dye; Essence

v.<Beauty>Coloring; changing the color of; whitewashing, rendering, giving color; blush

css color propertysyntax

Function: The color attribute specifies the color of the text.

Description: This attribute sets the foreground color of an element (in HTML representation, it is the color of the element text); raster images are not affected by color. This color also applies to all borders of the element, unless overridden by border-color or another border-color property. To set the foreground color of an element, the easiest way is to use the color attribute.

Note: Please use a reasonable combination of background color and text color to improve the readability of the text. All browsers support the color attribute. The attribute value "inherit" is not supported in any version of Internet Explorer (including IE8).

css color propertyexample

<html>
<head>
<style type="text/css">
body {color:red}
h1 {color:#00ff00}
p.ex {color:rgb(0,0,255)}
</style>
</head>
<body>
<h1>这是 heading 1</h1>
<p>这是一段普通的段落。请注意,该段落的文本是红色的。
在 body 选择器中定义了本页面中的默认文本颜色。</p>
<p class="ex">该段落定义了 class="ex"。该段落中的文本是蓝色的。</p>
</body>
</html>
Run instance »

Click the "Run instance" button to view the online instance

Popular Recommendations

Home

Videos

Q&A