CSS3

CSS3 is the latest standard for CSS. It is used to control the style of a web document in a simple and easy way. CSS stands for Cascading Style Sheet.

You can easily modify the colors and backgrounds of various HTML5 elements using CSS3. It’s allow you to provide a professional style to your Lists and Tables. A CSS declaration always ends with a semicolon, and declaration groups are surrounded by curly braces.

There are four ways to associate styles with your HTML document. Most commonly used methods are inline CSS and External CSS.

  • Embedded CSS (The style Element) – You can put your CSS rules into an HTML document using the style element. This tag is placed inside … tags.
  • Inline CSS (The style Attribute) – You can use style attribute of any HTML element to define style rules. These rules will be applied to that element only.
  • External CSS (The link Element) – The link element can be used to include an external stylesheet file in your HTML document.

    An external style sheet is a separate text file with .css extension. You define all the Style rules within this text file and then you can include this file in any HTML document using link element.

  • mported CSS (@import Rule) – @import is used to import an external stylesheet in a manner similar to the element.

CSS Rules Overriding:

We have discussed four ways to include style sheet rules in a an HTML document. Here is the rule to override any Style Sheet Rule.

  • Any inline style sheet takes highest priority. So it will override any rule defined in <style>…</style> tags or rules defined in any external style sheet file.
  • Any rule defined in <style>…</style> tags will override rules defined in any external style sheet file.
  • Any rule defined in external style sheet file takes lowest priority and rules defined in this file will be applied only when above two rules are not applicable.

CSS Comments:

Many times you may need to put additional comments in your style sheet blocks. So it is very easy to comment any part in style sheet. You simple put your comments inside /*…..this is a comment in style sheet…..*/.

You can use /* ….*/ to comment multi-line blocks in similar way you do in C and C++ programming languages.