Edit

What is CSS?

CSS full form is Cascading Style Sheets. It is used to represents the format and layout of the web pages. CSS is easy to learn and user friendly. If you want to become a good web designer then you must have a good knowledge about CSS.

What You can do with CSS.

  • You can do lots of task with CSS which are following.
  • You can easily apply same style rules on multiple HTML tags.
  • You can handle the layout of different or multiple pages of a website in a single style sheet.
  • You can style dynamic states of elements such as hover, focus, etc. that isn't possible otherwise.
  • You can present the same page differently on different devices such as labtop and mobile both have different layout.
  • You can change the position of the tag on a web page without changing the markup.
  • You can transform elements like scale, rotate, skew, etc. in 2D or 3D space.
  • You can create animations and transitions effects without using any JavaScript.

Here it is an example of CSS code with HTML

<!DOCTYPE html>
<html>
   <head>
      <title>This is document title</title>
   </head>
           <style type="text/css">
            p.paragraph{
                color: red;
            }           
           </style>    
   <body>
      <h1>This is a heading</h1>
      <p class="paragraph">Hello World!</p>
   </body>    
</html>

Output    

This is document title

This is a heading

Hello World!

Advantages of CSS

There are various advantages of CSS.

CSS Save Lots of Time - CSS gives lots of flexibility to set the style properties of an Html tags. you can write CSS once and access its code with multiple elements.

Easy Maintenance — You can easily update CSS code and change the style of the multiple web pages. Because the content of the entire set of web pages can be easily controlled using one or more style sheets.

Pages Load Faster — CSS enables multiple pages to share the formatting information, which reduces complexity and repetition the code of the document. It significantly reduces the file transfer size, which results in a faster page loading.

Superior Styles to HTML — CSS has much wider presentation capabilities than HTML and provide much better control over the layout of your web pages. So you can give far better look to your web pages in comparison to the HTML presentational elements and attributes.

Multiple Device Compatibility — CSS also allows web pages to be optimized for more than one type of device or media. Using CSS the same HTML document can be presented in different viewing styles for different rendering devices such as desktop, cell phones, etc.