Thursday, 19 December 2013

Thursday, December 19, 2013
Understanding the SyntaxIn the previous tutorial we gave you an idea about CSS. Why we are using it presently and how important it really is. If you have not read the tutorial then I suggest you do so. The link is below.

What is the CSS Syntax?

The CSS syntax is really simple and straight forward. It is divided into two main parts:
  • Selector : It is nothing but the HTML element that you want to apply the style to. As you can see in our example we have chosen the <h1> tag. This can be applied to any HTML elements.
  • Declaration : The declaration is divided in two parts, one is the property and the other is its value. The property is nothing but the style attribute that you are willing to change. Remember each property has a value. Not every value can be applied to any property. 
CSS Syntax
CSS Syntax

Some important things to remember :

  • Remember to end your CSS declarations with a semicolon (;).
  • All declaration groups are surrounded by curly brackets.
  • You can put one declaration in one line and make it more readable. That is allowed.
  • In CSS comments are also used. To use a comment begin with "/*" and end with "*/". They are simply ignored by the browser.

Here is an example to understand what we learned till now :

This concludes this tutorial. We are getting a huge number of suggestions for other tutorials as well. We will create them quite soon.

If you have a tutorial or article to share then do drop us a mail  at :


Post a Comment