Friday, 1 December 2017

, , ,

Lesson 2: CSS syntax with a example - arcreationsweb

lesson - 2 : css syntax

In last lesson we have discussed about what is CSS?, Why it is used? Why it is created? etc... If you read that than it's good otherwise go and read the last lesson first - Lesson 1: Introduction to CSS. Today in the lesson 2 we will discuss about what is the syntax to use CSS and how it gets implemented with HTML.






First of all do you know what is a SYNTAX? Syntax is any structure and arrangement of element. We need syntax everytime when you need to perform any task in any programming language. Syntax matters a lot. A wrong syntax of element never perform it's function. So do you know about the syntax of CSS? If yes than it's good otherwise concentrate here, I am going to tell you about the CSS syntax. So let's start without talking any more.

CSS syntax

A CSS rule-set or Syntax consists of a selector and a declaration Part.


css syntax

-The selector points to any valid HTML elements you want to style.
-The declaration block contains one or more declarations separated by semicolons.
-Every declaration block includes a CSS property name and a value, separated by a colon(:).
-A CSS declaration always ends with a semicolon(;), and declaration blocks are surrounded by curly braces {}

FOR EXAMPLE 

p
{
      color:red;
      font-size:100px;
}

In this example 'p' is any valid HTML element or tag which is being styled here. In this example the complete declaration block contains two different properties and value respectively. The first property is color whose value is RED and the another property is font-size whose respective value is 100px.  

So guys this is all about the CSS syntax and example. I have written the complete syntax for you. If you get any problem during understanding the syntax please let me know i will help you with the problem that you have. You can tell your problem in comment box and you can mail me personally on the given mail id - arcreationsweb@gmail.com

Thank You
Ashutosh Kumar
(writer and editor)
arcreationsweb



Share:

2 comments:

JOIN OUR DISCUSSION CORNER...