HOME | PHP Tutorial | CSS
facebook icon
PHP Tutorial

PHP forms
HTML Tutorial

CSS Tutorial

HTML Colors

HTML Tutorial » HTML Colors

CSS Color Values
With CSS, colors can be specified in different ways as:
1. RGB values
2. color names
3. hexadecimal values
4. HSL values (CSS3)

We can add Colors in different ways as:
Inline - by using the style attribute in HTML elements
Internal - by using a <style> element in the <head> section
External - by using an external CSS file as style.css

Syntax - Inline:
<tagname style="color:value">your text </tagname>
Note: use external CSS instead

Colors can be set by using color names - examples

Color Names:
With CSS, colors can be set by using color names:

Color Name

Example 1, colors can be set by using color name - example

<!DOCTYPE html>
<title>HTML colors can be set by using color name - example</title>
<h1>HTML colors can be set by using color name - example</h1>
<span style="color:red">Your text here</span>
<p style="color:yellow; background-color:blue">Text here -
With CSS, colors can be set by using color names - example</p>
Note: Use internal or external CSS instead.

HTML RGB Colors - examples

RGB color values are supported in all browsers.

RGB color system, constructs all the colors from the combination of the Red, Green and Blue colors.

An RGB color value is specified with: rgb( RED , GREEN , BLUE ).

Each parameter defines the intensity of the color as an integer between 0 and 255.

Color RGB

Example: HTML RGB Colors - examples:
<!DOCTYPE html>
<title>HTML RGB Colors - example</title>
<h1>HTML RGB Colors - example</h1>
<span style="color:rgb(255,0,0)">Your text here</span>
<p style="color:rgb(0,255,0); background-color:rgb(0,0,255)">Text here -
With CSS, colors can be set by using color names - example</p>

HTML Hexadecimal Colors - examples

Hexadecimal numbers are used on web pages to set colors.
The color is defined by its mix of Red, Green and Blue, each of which can be in the range:

A hexadecimal color is specified with: #RRGGBB.

Color HEX RGB Color
  #FF0000 rgb(255,0,0) Red
  #00FF00 rgb(0,255,0) Green
  #0000FF rgb(0,0,255) Blue

Example: HTML Hexadecimal Color - examples:
<!DOCTYPE html>
<title>HTML Hexadecimal Colors - examples - example</title>
<h1>HTML Hexadecimal Colors - examples - example</h1>
<span style="color:#FF0000">Your text here</span>
<p style="color:#00FF00; background-color:#0000FF">Text here -
With CSS, colors can be set by using color names - example</p>

HTML Colors names, codes, picker, background, palette, hex, green, color HTML Colors - html tutorial

3066. HTML Website Templates
Learn about HTML website templates with this HTML tutorial.

2678. Metatags : Introduction - HTML Tutorial
HTML metatags - HTML tutorial

871. HTML a tag and element - HTML tutorials - w3resource


2187. HTML Tutorial - Durchgestrichen
Durchstreichen, Beispiele und Anwendungen

2136. HTML Tutorial - Italic, blockquote, address
Italic text Italic, blockquote, address

2121. HTML Tutorial - Using The Div Tag
Making web pages with div tag

Your add here
PHP define() function

PHP print() function

PHP strlen() function

PHP explode() function

PHP count() Function

PHP str_split() function

PHP strtolower() function

PHP str_repeat() function

PHP isset() Function

PHP strrchr() Function

PHP htmlentities() function

PHP empty() Function

PHP wordwrap() function

PHP strstr() function

PHP htmlspecialchars_decode() function

PHP implode() function

CSS Font Size
SQL Select data from a database.
CSS background, Color, Background Image
CSS Style Scrollbar in Div
Basic Syntax of CSS - How to Code CSS
How to get PHP errors to display?