?>
profile image
Announcements
No new announcements.
mentora icon
bookmark
Table of Contents

    CSS Syntax and its Components

    In this lesson, we will learn about CSS syntax and its various includes.

    CSS Syntax

    CSS syntax consists of three includes and they are:

    • selector
    • property
    • value
    Video Explanation

    Click the button below to watch the explanation.

    video image

    The property and value of a selector is written within curly braces. We can apply multiple properties on a selector as shown in the image below.

    CSS Syntax

    Let's explore each component in detail.

    Selector

    A selector targets HTML elements to apply styles. It can be an element selector, class selector, ID selector, or other advanced selectors.

    For example, if you want to apply CSS on a paragraph, you can write CSS as:

    Example
    p {
        font-weight: bold;
    }

    In the above example, p is an element selector, font-weight is a CSS property and bold is its value. We will learn more about different types of CSS selectors in the next lesson.

    Property

    A property defines the specific aspect of an element that you want to style. For example color, background-color, font-size, font-weight, etc.

    Value

    A value specifies the desired setting for a particular property. For example, a value for the color property could be red or #FF0000.

    Test Your Knowledge

    Attempt the questions in the exercise to check whether you have understood the lesson clearly.

    Test Your Knowledge
    Mentora Question Asked: 0 / 20

    Hi, I’m Mentora!

    I’m your personal AI tutor from Dremendo. Ask me anything, and I’ll help you understand it in a simple and easy way.