css

CSS color property

The CSS color property is used to set the text color of an element. The value can be a named color (such as “red” or “blue”), a hex code (such as “#ff0000” for red or “#0000ff” for blue), an RGB or RGBA value (such as “rgb(255, 0, 0)” for red or “rgba(0, 0, 255, 0.5)” for blue with 50% opacity), HSL or HSLA value. The property can be applied to a specific element by using a selector and the style attribute, or to multiple elements by using a ID or class selector in a stylesheet.

<p style="color: yellow;">This text is yellow</p>

or

.sample-class {
  color: #4CAF50;
}
<p class="sample-class">This text is green</p>
Posts created 494

Related Posts

Begin typing your search term above and press enter to search. Press ESC to cancel.

Back To Top