WebTrainingRoom Online Courses
Online Training for Asp.net MVC Web Designing Development, MS SQL, Digital Marketing

Use Color using CSS Code Example


You need to play with color in webpage very often; Using CSS there are different ways to specify color for any HTML element.

  • Color using Hex Code
  • Color using RGB
  • Color using Name

Color using Hex Code Example

<style>
.splDiv
{
 color: #000;
background-color: #dcdcdc;
}
</style>

Color using RGB Example

<style>
.splDiv
{
color:rgb(186,32,24);
background-color: rgb(255,255,255);
}
</style>
Color using Name Example
<style>
.splDiv
{
color: white;
background-color: red;
}
</style>

You can define color to any html element, here are some examples

<div class="splDiv"></div>
<span class="splDiv"></span>
<p class="splDiv"></p>

Comment
Name Email Website
Subscribe
 
Color CSS Style, CSS Tutorial




Consulting