2016-06-17

Css stands for cascading style sheet . The work on a style sheets standard for the web did not begin until bert bos of the world wide web consortium (w3c) wrote a charter to do so in 1995. eventually hkon lie, also of the w3c, introduced a proposal for cascading style sheet; in december 1996, this proposal became the w3’s recommendation of cascading style sheets level 1(css1). style sheets might sounds wonderful, but the fact remains that they still are not widely supported. internet explorer3 and 4 , netscape 4 and later versions of both browsers all support css1-based style sheets to some degree but no widely used browser supports all aspects of the w3c css definition and now w3c has finalized the css level 2 (css2) specifications which incorporates many of the features introduced by browsers vendors notably positioning features and introduces new features to support aural processing of styles and printing features, other than outside positioning most of css2 is unsupported in any 4.x generation browser ( although forthcoming 5.x generation browsers probably will include more css2 support).

Style sheets basics

css1 style sheets rely on an underlying markup structure such as html. they are not the replacement for html. the purpose of a style sheet is to create a presentation for a particular element or set of elements. binding an element to a style specification is very simple it consist of an element followed by its associated style information with in curly braces:

Element         { style specification}

for example you want to apply a style rule to the <h1> element so that a 20 point impact font is always used. the following rule would result in the desired display:

h1       {font-family: impact ; font-size: 20pt}

in simple a style specification or style sheet is simply a collection of rules. these rules include a selector an html element a class name or id value which is bound to a style property such as font-family, followed by a colon and the value(s) for that style property. multiple style rules may be included in a style specification by separating the rules with semicolons. advance style rules contextual selection grouping and inheritance. style sheet alone do nothing first you must bind the rule to a tag(s) or class of html objects. currently 50 properties are specified under css1 that effect  the presentation of an html document and more than 50 properties are defined under css2.

linking to a style sheet

an external style sheet is simply a plain text file containing the style specifications for html tags and classes. the extension indicating  that the document provides styles sheet information is  .css, for cascading style sheets.an html file that uses this style sheet could reference it by using the <link> tag with in the <head> element of the document. <link> element to style sheet has a variety of possible relationship setting that can be set with the rel attributes.

this book provides a concise look at style sheet rules a listing of commonly supported  css1 style properties and their values and their current compatibility with major browsers. testing of pre release version of netscape’s new browser engine suggests that future netscape browsers will support a wider range of style sheet properties. cascading style sheets 2 (css2) positioning properties also supported by the most recent browser versions, and included this book

The following is an example of how style sheet linking is used

Text color

Text color property sets the color of text. Values can be in the form of color names hex values in three or six digit format or red-green blue (RGB) values (numbers or percentages).

Open the notepad and type the following code:



Save the file with name TEST.CSS



This is the cascading style sheet document (TEST.CSS)



again open the notepad and type the following code to make link with TEST.CSS

and save the file with the name INDEX.HTML

Color Headings

CSS TAGS CHART

Tag

Name

Code Example

Browser View/Output

45 total views, 1 views today

The post CSS Complete Introduction, Structure For Beginner appeared first on Information Technology.

Show more