Introduction to CSS


  • Cascading Style Sheets
Cascading Style Sheets (CSS) is a simple mechanism for adding style (e.g., fonts, colors, spacing) to Web documents. CSS can control the style and layout of multiple Web pages all at once.
  • What is CSS?
  1. CSS stands for Cascading Style Sheets
  2. Styles define how to display HTML elements
  3. Styles were added to HTML 4.0 to solve a problem
  4. External Style Sheets can save a lot of work
  5. External Style Sheets are stored in CSS files

  • Example(demo.css):
    body
    {
       font-family:arial;
       background-color:grey;
    }
    h1
    {
       font-size:28pt;
    }
    h2
    {
       color:blue;
    }
    p
    {
       margin-left:50px;
    }

  • Use of CSS:
<html>
<head>

<link rel="stylesheet" type="text/css" href="demo.css" />

</head>
 <body>
   <h1>This header is 28 pt</h1>

   <h2>This header is blue</h2>

   <p>This paragraph has a left margin of 50 pixels</p>
 </body>
</html>


0 comments:

Post a Comment

 
Design by Wordpress Theme | Bloggerized by Free Blogger Templates | coupon codes