Functional Notation - HTML CSS CSS

HTML CSS examples for CSS:Color

Introduction

The RGB value in functional notation is specified with: rgb(red, green, blue).

(red, green, blue) defines the color and can be an integer value (from 0 to 255) or a percentage value (from 0% to 100%).

The integer value 255 corresponds to 100%, and also can be converted to f or ff in the hexadecimal notation:

For example, rgb(0,255,255) = rgb(0%,100%,100%) = #0ff, and all values represents the same color which is aqua.

Example

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
 <head>
  <title>CSS Functional Notation</title>
  <style type="text/css">
    h1 {<!-- w  w w  .j  a va 2s. co  m-->
        color: rgb(0,255,255);
    }
    p {
        background-color: rgb(0%,100%,100%);
    }
</style>
 </head>
 <body>
  <h1>This is a heading</h1>
  <p>This is a paragraph.</p>
 </body>
</html>

Related Tutorials