Featured

    Featured Posts

Applying CSS Rules

 

How to apply CSS Rules:

  §  In This tutorial we will discuss how to apply CSS to the HTML elements.

  §  We can apply CSS to html element just by defining the CSS rules.

  §  A CSS comprises of style rules that are interpreted by the browser and then applied to the corresponding elements in your document.

  §  CSS rule is made up of two parts.

      · Selector·   Declaration

Selector

  §  With the help of the selector, we Identifies the HTML elements at which the CSS rule is to be applied correctly .i.e. identified by the actual element name, e.g. <body>, <p>, <h1>

    Declaration

  §  Declaration part contains property and value.

    Property

  §  The properties are the style attribute put simply, all the HTML attributes are converted into CSS properties. They could be color, border etc.

    Value

  §  Values are assigned to properties. For example, color property can have value either  red or #F1F1F1 etc.

    Example: -

  §  Suppose that we want size of our text 10px then it declare as font-size: 10px. Here font-size is properties and 10px is there value, and all this declaration is called declaration.

Syntax:

Note:

  §  With-in Declaration Block we specify the declaration of property. The declaration is also split into two parts, they are separated by a colon " : " i.e.  property and value  is separated by colon ":"

  §  However, because a declaration can consist of several property - value pairs, and each property - value pair within a rule must be separated by a semicolon.




CSS (Cascading Style Sheets)

 CSS (Cascading Style Sheets)

  §  In This tutorial we will discuss CSS stands for Cascading Style Sheets. 

  §  This tutorial covers both the versions CSS1, CSS2 and CSS3, and gives a complete understanding of CSS, starting from its basics to advanced concepts.

Introduction of CSS

  §  CSS stands for Cascading Style Sheets. CSS is a standard style sheet language used for describing the presentation (i.e. the layout and formatting) of the web pages.

  §  CSS stands for Cascading Style Sheets. Styles define how to looks like the HTML elements.

  §  When we are working with development of the large websites became a long and expensive process, since the style information was repeatedly added to every single page of the website.

  §  To writing style information to every page which are repeatedly required makes complex

  §  To resolve this problem CSS was introduced in 1996 by the World Wide Web Consortium (W3C).

  §  Using Html we can design a web page.

  §  Now CSS was designed to enable the separation of presentation and content.

  §  Now web designers can move the formatting information of the web pages to a separate style sheet which results in considerably simpler HTML markup, and better maintainability.

    Definition of CSS

  §  Cascading Style Sheets (CSS) is a rule based language that applies styling to HTML elements.

  §  CSS is used to design HTML tags.

  §  CSS is a widely used language on the web.

  §  We write CSS rules in Html elements (<p>, <img>), and modify properties of those elements such as color, background color, width, border thickness, font size, etc.

 Advantages of Using CSS

  §  The biggest advantage of CSS is that content and style can be kept separately.i.e CSS allows the separation of style and layout from the content of the document.

Easy Maintenance

  §  With the help of CSS, we can update the formatting of the document in a very simple way. And manage consistency in multiple documents because we can control the style of the entire web page by maintaining one or two CSS files.

Superior Styles to HTML

  §  CSS has more capability of the presentation than the HTML and provide much better control over the layout of your web pages, i.e. that you can prepare the presentation of your web pages in better look comparison to the HTML presentational elements and attributes.

Saves a lot of time

  §  Using CSS we can save a lot of time by saving CSS in external file so it is possible to change the entire website by changing just one file.

 

 

 

 

www.CodeNirvana.in

Powered by Blogger.

About

Site Links

Popular Posts

Translate

Total Pageviews