CSS3 > Texts

Text Color in CSS3

How to set the text-color for different elements in CSS3?

By using color property we can set the text-color for different elements. Color property specifies the color of the text.

        p {
            color: green;

        div {
            color: orange;

        body {
            color: blue;

        .class {
            color: violet;

    <p>This is 'P' element.</p>
    <br />
        This is 'DIV' element.
    <br />
    <b>This is BOLD content.</b>
    <form class="class">
        Enter Name<input type="text" />

In the above code snippet, we have given direct color to the <p> element, <div> element, <b> element and for the <form> element color is given with the .class selector.


 Views: 3459 | Post Order: 40

Write for us

Hosting Recommendations