Friday 31 August 2012

What is CSS,Type of Css,Inline,Internal,External Style Sheet

CSS (Cascading Style Sheets)


 What is CSS? 

CSS stands for cascading style sheets Styles define how to display HTML elements Styles are normally stored in Style Sheets Styles were added to HTML 4.0 to solve a problem External Style Sheets can save you a lot of work External Style Sheets are stored in CSS files Multiple style definitions will cascade into one.

                Style sheets are a very powerful tool for the Web site developer. They give you the chance to be completely consistent with the look and feel of your pages, while giving you much more control over the layout and design than straight HTML ever did.


Types of CSS: There are three type Style sheets

a.    Inline Styles
b.    Internal Style Sheet
c.    External Style Sheet

 Inline Styles: An inline style loses many of the advantages of style sheets by mixing content with presentation. Use this method sparingly, such as when a style is to be applied to a single occurrence of an element.
To use inline styles you use the style attribute in the relevant tag. The style attribute can contain any CSS property. The example shows how to change the color and the left margin of a paragraph:

For Example:

<p style="color: red; margin-left: 20px">
     This is a paragraph
    </p>

   Internal Style Sheet: An internal style sheet should be used when a single document has a    unique style. You define internal styles in the head section by using the <style> tag, like this:

  <head>
  <style type="text/css">
   hr {color: green}
   p {margin-left: 20px}
   body {background-image: url ("images/kushtiwari.gif")}
   </style>
  </head>

The browser will now read the style definitions, and format the document according to it.



External Style Sheet:  An external style sheet is ideal when the style is applied to many pages. With an external style sheet, you can change the look of an entire Web site by changing one file. Each page must link to the style sheet using the <link > tag. The <link > tag goes inside the head section:

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


Other CSS Questions



Question: Style Sheets Can Save a Lot of Work

Answer:
 Enforcing data integrity ensures the quality of the data in the database. For example, if an employee is entered with an employee_id value of 123, the database should not allow another employee to have an ID with the same value. If you have an employee_rating column intended to have values ranging from 1 to 5, the database should not accept a value of 6. If the table has a dept_id column that stores the department number for the employee, the database should allow only values that are valid for the department numbers in the company. Two important steps in planning tables are to identify valid values for a column and to decide how to enforce the integrity of the data in the column. Data integrity falls into these categories.

Question: When do you use CSS dimension?

Answer: The CSS dimension properties allow you to control the height and width of an element. It also allows you to increase the space between two lines.

Question: CSS purpose and Used for?

Answer:
CSS is a language, separate from HTML or XHTML CSS used to specify the layout or formatting properties of HTML elements From a single CSS file you can control an entire sites:
font type ,font and element color ,padding ,margins ,and element positioning CSS allows developers to separate style (look, appearance, colors, fonts, layout) from the pages structure.


Question: What is the CSS Web Template?

Answer:
"CSS Web Template"  is a website design created using Cascading Style Sheets (CSS) technology. Cascading style sheets provide web developers an easy way to format and to style web pages. CSS will be used even more because it is seen the same way by all browsers, making it the best option during the browser wars.


                                                                                                                           Next Topic with CSS

2 comments:

  1. is the type of css same in html or asp.net ?

    ReplyDelete
  2. I am very much pleased with the topic you have chose for. I enjoyed every little bit part of it.
    Melbourne Web Designer

    ReplyDelete