Monday 22 April 2013

CSS Introduction


CSS Introduction

What is CSS?

  • CSS stands for Cascading Style Sheets.
  • CSS is an extension to basic HTML that allows you to style your web pages.
  • External Style Sheets can save a lot of work.
  • External Style Sheets are stored in CSS files.

Use Of CSS
  • Use of CSS is the recommended way of defining how HTML pages are displayed. 
  • You should use HTML to define the basic structure (using elements such as <h1>, <p>, <li>, etc.) and CSS to define how these elements should appear (e.g. heading should be in bold Arial font, paragraphs should be indented, etc.).


Applied the style

      <style type="text/css">
      .myNewStyle 
      {
   font-family: Verdana, Arial, Helvetica, sans-serif;
           font-weight: bold;
           color: #FF0000;
      }
      </style>
 
        In the above example we embed the css code directly into the page itself.


Example

<div style="width:150px; height:150px; 
margin:0 auto; border:1px black solid; background:#ddd;text-align:center;">This is my box</div>

Output

In middle of  div the text “This is my box”  display.

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More