How Can I Specified Predefined Colors Names In CSS

admin_img Posted By Bajarangi soft , Posted On 30-10-2020

In CSS Colors are specified using predefined color names, or RGB, HEX, HSL, RGBA, HSLA values.

How Can I Specified Predefined Colors Names In CSS

Create index.html file and implement as below code in it.
 

<h2 style="background-color:Tomato;">Tomato</h2>
<h2 style="background-color:Orange;">Orange</h2>
<h2 style="background-color:DodgerBlue;">DodgerBlue</h2>
<h2 style="background-color:MediumSeaGreen;">MediumSeaGreen</h2>
<h2 style="background-color:Gray;">Gray</h2>
<h2 style="background-color:SlateBlue;">SlateBlue</h2>
<h2 style="background-color:Violet;">Violet</h2>
<h2 style="background-color:LightGray;">LightGray</h2>


Complete Code For Specifying Predefined Colors Names In CSS
<!DOCTYPE html>
<html>
<head>
    <title>How Can I Specified Predefined Colors Names In CSS</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"/>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<style>
    body {
        background: pink;
    }
</style>
<body>
<br/><br/>
<div class="container">
    <br><br><br>
    <div class="text-center">
        <h1 id="color" style="color: black;">Specified Predefined Colors Names In CSS</h1>
    </div>
    <br>
    <div class="well">
        <h2 style="background-color:Tomato;">Tomato</h2>
        <h2 style="background-color:Orange;">Orange</h2>
        <h2 style="background-color:DodgerBlue;">DodgerBlue</h2>
        <h2 style="background-color:MediumSeaGreen;">MediumSeaGreen</h2>
        <h2 style="background-color:Gray;">Gray</h2>
        <h2 style="background-color:SlateBlue;">SlateBlue</h2>
        <h2 style="background-color:Violet;">Violet</h2>
        <h2 style="background-color:LightGray;">LightGray</h2>
    </div>
    <br>
</div>
</body>
</html>

Related Post