HOME | PHP Tutorial | CSS
facebook icon
AgerNic.com
WEB DEVELOPER SITE, HTML, CSS, PHP
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
 Wite
 Gray
 Red
 Yellow
  Green
 Brown
 Cyan
 Blue
 Magenta
 Black

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

<!DOCTYPE html>
<html>
<head>
<title>HTML colors can be set by using color name - example</title>
</head>
<body>
<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>
</body>
</html>
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
  rgb(255,0,0)
  rgb(0,255,0)
  rgb(0,0,255)


Example: HTML RGB Colors - examples:
<!DOCTYPE html>
<html>
<head>
<title>HTML RGB Colors - example</title>
</head>
<body>
<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>
</body>
</html>


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>
<html>
<head>
<title>HTML Hexadecimal Colors - examples - example</title>
</head>
<body>
<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>
</body>
</html>

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.
https://www.quackit.com/html/tutorial/html_website_templates.cfm

2678. Metatags : Introduction - HTML Tutorial
HTML metatags - HTML tutorial
http://www.echoecho.com/htmlmetatags.htm

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

https://www.w3resource.com/html/attributes/HTML-attributes.php

2187. HTML Tutorial - Durchgestrichen
Durchstreichen, Beispiele und Anwendungen
https://tutorialehtml.com/de/html-durchgestrichen/

2136. HTML Tutorial - Italic, blockquote, address
Italic text Italic, blockquote, address
https://tutorialehtml.com/en/html-tutorial-italic-em/

2121. HTML Tutorial - Using The Div Tag
Making web pages with div tag
https://tutorialehtml.com/en/html-tutorial-div-tags/

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?