What Is The Basic Syntax Of Cascading Style Sheets

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

A CSS rule-set consists of a selector and a declaration block.The selector points to the HTML element you want to style.The declaration block contains one or more declarations separated by semicolons.Each declaration includes a CSS property name and a value, separated by a colon.Multiple CSS declarations are separated with semicolons, and declaration blocks are surrounded by curly braces.

What Is The Basic Syntax Of Cascading Style Sheets

CSS Syntax

<style>
    h1 {
        color: red;
    }
</style>


Description 
H1 element   - Selector.
color              - property.
red                 - value.


Complete Code For Basic Syntax Of Cascading Style Sheets

<!DOCTYPE html>
<html>
<head>
    <title>The Basic Syntax Of Cascading Style Sheets</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: black;
    }
    h1 {
        color: red;
        text-align: center;
    }
</style>
<body>
<br /><br />
<div class="container">
    <br><br><br>
    <div class="text-center">
        <h1 id="color" style="color: White;">The Basic Syntax Of Cascading Style Sheets</h1>
    </div>
    <br>
    <div class="well">
        <p>Hello World!</p>
        <p>These paragraphs are styled with CSS.</p>

    </div>
    <br>
</div>
</body>
</html>

Related Post