Close Menu
    Facebook X (Twitter) Instagram
    Oixiesoft
    • Home
    • Services
      • WordPress Malware Removal
      • Fix WordPress Errors
      • WordPress Website Development
    • Articles
    • Contact
    Oixiesoft
    Home»Tutorial»html»HTML Colors
    html

    HTML Colors

    Editorial StaffBy Editorial StaffUpdated:April 25, 2022No Comments2 Mins Read
    Share
    Facebook Twitter LinkedIn Pinterest Email

    Colors play an important role to give a good look and feel to your website. You can define colors on page level using Html <body> tag.

    The <body> tag has subsequent attributes that can be used to set various colors:

    • bgcolor: Specifies a color for the background of the page.
    • text: Specifies a color for the body text.
    • alink: Define a color for active links or selected links.
    • link: Selects a color for linked text.
    • vlink: Assigns a color for visited links – that is, for a linked text that you have already clicked on.

    NOTE: It is suggested to use CSS to put background or text colors.

    HTML Color Coding Methods:

    There are observing three different ways to select colors on your web page:

    • Color names: Specify color names instantly like blue, red, or green.
    • Hex codes:A six-digit code describing the amount of black, green, and red that make up the color.
    • Color decimal or percentage values: : This value is determined using the RGB( ) property.

    Color Names:

    In HTML, colors can be specified directly by a color name to set text or background color. There are listed 16 basic color names:

    Black Gray Silver White
    Yellow Lime Aqua Fuchsia
    Red Green Blue Purple
    Maroon Olive Navy Teal

    Background Color

    <!DOCTYPE html> 
    <html> 
    <body style="background-color:red;">
     
    <p>This is my first paragraph.</p> 
    <p>This is my second paragraph.</p>
     
    </body> 
    </html>
    

    Output

    This is my first paragraph.

    This is my second paragraph.

    Text Color

    <!DOCTYPE html> 
    <html> 
    <body">
     
    <p style="color:green;">This is my first paragraph.</p> 
    <p>This is my second paragraph.</p>
     
    </body> 
    </html>
    

    Output

    This is my first paragraph.

    This is my second paragraph.

    HTML Colors – Hex Codes:

    Hexadecimal is a 6-digit model of color. The first two digits(RR) describe a red value, the next two are a green value(GG), and the last is the blue value(BB).
    Each hexadecimal code will be started by a hash sign #.

    Color Color HEX
    #000000
    #FF0000
    #00FF00
    #0000FF
    #FFFF00
    #00FFFF
    #FF00FF
    #C0C0C0
    #FFFFFF

    HTML Colors – RGB Values:

    RGB the color value is defined using the rgb( ) property. This property takes three values, one each for red, green, and blue. The value can be an integer between 0 and 255 or a percentage.

    rgb(0,0,0)
    rgb(0,255,0)
    rgb(255, 99, 71)
    rgb(192,192,192)
    Share. Facebook Twitter Pinterest LinkedIn WhatsApp Reddit Tumblr Email
    Editorial Staff

    Related Posts

    CodeIgniter vs Laravel: A Detailed Side-by-Side Comparison

    Python Arrays

    Python Lambda

    • HTML Introduction
    • HTML Editors
    • HTML Tags
    • HTML Attributes
    • HTML Headings
    • HTML Paragraphs
    • HTML Comments
    • HTML Styles
    • HTML Text Formatting
    • HTML Colors
    • HTML links
    • HTML Images
    • HTML Styles – CSS
    • HTML Tables
    • HTML Lists
    • HTML Forms
    Services
    • Web Development
    • Mobile Application Development
    • WordPress Malware Removal Service
    • Website Design
    • WordPress Development
    • Magento Development
    • Shopify Development
    • SEO Services
    Blog
    • How to Fix the Error Establishing a Database Connection
    • Ping List WordPress
    • How To Fix Japanese Keyword Hack
    • How to remove Malware from WordPress
    Hire Developers
    • Hire WordPress Developer
    • Hire Shopify Developer
    Contact Info
    • Oixiesoft Technologies
      A-40, Block A, I thum Tower, Sector 62, Noida
    • sales@oixiesoft.com
    • Privacy Policy
    • About Us
    • Contact Us
    © 2025 OixieSoft Technologies

    Type above and press Enter to search. Press Esc to cancel.